In this post, I will show you how to use Publish activity inside OSB to call external service. We have created a one-way SOA composite and deployed it to server, we will call this service from OSB using Publish activity.
First create a one-way SOA composite and deploy it to server. Then create a OSB project and add required folders (business, proxy, resources) to it.
Under resources folder add/import SOA composite schema and WSDL file.
Now go to business folder and create a business services based on SOA composite WSDL. Accept defaults and complete your business service creation.
Now we will create proxy service based on same WSDL file.
Now go to message flow of proxy service and add Pipeline pair to it.
In the request pipeline add Stage activity.
Inside stage, add Publish activity to call external service.
Click on “Service” link and choose newly created business service.
Choose external service operation.
Now we will do external service request message assignment. In this Post we are using same WSDL for proxy & business service so we really don’t required to assign value to request message of external service, but to show how to assign value if WSDL file is different for proxy & business service.
Here we are assigning constant value to external service request message.
Sample Code can be downloaded from here.