Friday, October 11, 2019

12c OSB - Get Rest xml to JSON response using rest adapter

Create a service bus project.


Response Payload:
In XML:
<CustomerResponse>
<ID>11</ID>
</CustomerResponse>
In JSON:
{
  "CustomerResponse": { "ID": "11" }
}

Click here www.utilities-online.info-xmltojson to convert from XML to JSON
 Create a REST adapter on left swim lane

 Provide the Resource path

 Create the GET operation with request payload
  Browse for request schema



 Now Response part
 Define Schema for Native Format




 Provide the sample created JSON payload




 Get Rest adapter is ready.
 Now create a pipeline









 Now create a Xquery to map response







 Xquey is ready. Now go to the pipeline
 In the Replace activity, choose the created xquery for response and put the variable xpath


 Now test from SOAP UI:

12c OSB - Invoke exposed get SOA service from OSB service project

Create a service bus project.


Create a REST adapter on right swim lane

 Click the Configuration shortcut and add the wadl file
 http://hostname:8001/soa-infra/resources/POC/GetRestCustomerProject!1.0/GetCustomerService/application.wadl
 Parsing wadl
 It has parsed all the details from the wadl.

 Business service is ready to test
 deploy the jar file on service bus server and test the pipeline

The same way we can also invoke the post rest service from OSB project.

Thursday, October 10, 2019

12c OSB - Expose post rest OSB service using rest adapter

Create a service bus project.


 Create a REST adapter on left swim lane
Provide the rest adapter name, Type as "Service" and checked the service will invoke components using WSDL interfaces option.
Provide the Resource path name

 Click on plus sign to add the operation, HTTP verb and request response details.






 Now drag a pipeline and choose the created wsdl file


 De-select the expose as a proxy service


 Open the pipeline and add a stage it it
 Provide the xpath which to be sent as a response.


Test from SOAP UI:
Format:
http://localhost:<<OSB Port>/<<proxy endpoint>>/<<resource name>>
Rest URI:
http://hostname:2001/PostRestSBProject/RestService/Customer

 Test JSON Payload
 Test XML Payload

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...