Forum Stats

  • 3,770,167 Users
  • 2,253,079 Discussions


Oracle SOA 12c REST Service consumption shows bad request

User_XRB76 Member Posts: 17 Red Ribbon
edited Oct 5, 2018 7:02AM in SOA Suite Discusssions


I have developed a simple composite to consume a REST service using JDeveloper The setup using the REST adapter wizard is attached. I have one template parameter 'IntId ' which is based on expression - $msg.request/pns:IntId. I am passing value to this in the BPEL component through the assign activity.

This fails with below error

<bpelFault><faultType>0</faultType><bindingFault xmlns=""><part name="summary"><summary>Bad Request</summary></part><part name="code"><code>400</code></part><part name="detail"><detail>URL request parameter IntId cannot be used in this context.</detail></part></bindingFault></bpelFault>

1. Is using the assign activity the right way to pass the value to 'IntId ' ?

2. If I modify the URI to have query parameters, how to pass the values at run time ?

I have attached the relevant security policy as well. Please provide pointers to address the issue.




Best Answer

  • RakeshKr
    RakeshKr Member Posts: 401 Silver Badge
    edited Oct 5, 2018 6:14AM Accepted Answer

    For simple JSON, mapping is quite easy. Lets say you get something like this in response:

      "message": "success",
      "poNumber": "1234"

    Your response JSON variable is varJSONResponse and you have a xml variable varXMLString.

    Put an assign activity after the invoke. In the assign select "javascript" as Expression Language. Map varJSONResponse to varXMLString. After the mapping in the From you will see "process.varJSONResponse", double click on that and add "poNumber" in the end. It will be "process.varJSONResponse.poNumber" -> "varXMLString". You got the poNumber mapped.

    Now if you have a complex JSON with arrays and all, you can use the "Translate" activity to translate native JSON to XML.



This discussion has been closed.