My Oracle Support Banner

PJO: How To Use AppComposer To Call Project Budget REST API/ Web Services (Doc ID 2556077.1)

Last updated on JANUARY 06, 2020

Applies to:

Oracle Fusion Project Control Cloud Service - Version 11.13.19.04.0 and later
Information in this document applies to any platform.

Goal

On : 11.13.19.04.0 version, Plan Project-Manage Project Budget

We are trying to call 'Create a planning resource' RestAPI using AppComposer but receiving an error -

Error:oracle.binding.expr.ServiceInvocationException: JBO-29000: Unexpected exception caught: oracle.adf.model.connection.rest.exception.RestConnectionException, msg=JBO-57001: Invocation of service URL used in connection failed with status code 400 Bad Request.

REST API
https://docs.oracle.com/en/cloud/saas/project-portfolio-management/18c/fapap/op-
projectbudgets-planversionid-child-planningresources-post.html

Payload

def reportRequest =
[
byPassCache :true,
flattenXML :false,
reportAbsolutePath :'/Custom/Projects/Test/PlanIDReport.xdo',
sizeOfDataChunkDownload :10000,
parameterNameValues:
[
item:
[[
dataType:'xsd:string'
, useNullForAll:false
, refreshParamOnChange:false
, name:'P_NAME'
, templateParam:false
, multiValuesAllowed:false
, defaultValue:-1,
selectAll:false,
values:
[
item:
[[
item : Name_c,
]],
],
]],
],

]
def report = adf.webServices.PublicReport.runReport(reportRequest, 'Test.Rest', 'Test123');
//println("report: " + report)

def encoded = report.reportBytes
def decoded = decodeBase64(encoded)

decoded.eachLine{ line,count ->
if (count > 0) {
//println(" Line $count : $line");
def planvid = line.substring(line.lastIndexOf(",") + 1);
// values[1] = Planvid_c
// println('values ' +values)
Planvid_c = planvid
//throw new oracle.jbo.ValidationException('planvid ' +planvid)
}
}

def opty = adf.webServices.PlanVersionIDS
try{
def PlanVersionId = '10001'//Planvid_c.toString()
def POST_param =
[
ResourceName:"Exempt",
TaskNumber:"9999",
PlanningAmounts:
[[
Currency :"USD",
PlanningAmountDetails:
[[
RawCostAmounts:500,
PeriodName:"May-19",
]]
]]
]
def httpHeaders =['Content-Type':'application/json','Accept-Language':'es-ES']
println('http ' + httpHeaders)
opty.requestHTTPHeaders = httpHeaders
println ( "Headers:" + opty.responseHTTPHeaders)
def newOpty = opty.POST(PlanVersionId,POST_param)
println('newopty ' +newOpty)
throw new oracle.jbo.ValidationException('Plan Version '+ newOpty)

}catch ( Exception e ){
println ( "Headers:" + opty.responseHTTPHeaders)
println ( "-----------------------------------------------------")
println ( "Status:" + opty.statusCode)
println ( "-----------------------------------------------------")
println ( "Error:" + e)
println ( "-----------------------------------------------------")
}

Please advice.

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.