Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to set JSON response in OSB REST service

Peter551059Feb 20 2025 — edited Feb 25 2025

Hi, I have OSB service with http REST proxy as inbound and http SOAP business service as outbound to SOA BPEL process.

The pipeline takes REST parameters and put XML request message to body in request pipe. In response pipe I construct JSON response message body back from XML BPEL response.

But I get error because returned JSON is wrapped in SOAP body tags <body>{"result" : "everything"}</body>

I construct JSON using javascript:

var ns = new Namespace("http://xmlns.oracle.com/Test_Application/Test_Project/Test_BPELProcess");
var jsonItem = "\"result\" : \""+ process.responseXML.ns::processResponse.ns::result.text();
process.body = "{"+ jsonItem +"\"}";

I still miss something or just putting JSON in wrong place.

Actualization:

Service test give me expected response

But when I try call this service from another SOAP service I found response body logged as

<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">{"result":"Hello null"}</soapenv:Body>

Using loging and reporting I have found that SOAP service outbound is OK.

<http:query-parameters>
	<http:parameter  name="id"  value="1"/>
</http:query-parameters>

but inbound or REST service added missing parameter

<http:query-string>id=1</http:query-string>
<http:query-parameters>
	<http:parameter  name="id"  value="1"/>
	<http:parameter  name="name"  value="null"/>
</http:query-parameters>

Thank you in advance.

Comments

Processing

Post Details

Added on Feb 20 2025
0 comments
70 views