Scenario:
The requirement was to send the file name(custom defined) to the target system. The actual payload to the target system was not having any field to hold the fileName so we proposed to pass the same using headers.
Steps to make it working:
First is to create a variable to type string in your BPEL process.I named it as FileName
Next is create a property variable while calling the partnerlink using invoke activity. Go to the source code of your invoke activity which is calling the OSB service and add a property as shown below
Here fileName is the name of the property variable and its value is coming from the variable that we have created earlier "FileName". Now before the invoke activity you have to make sure that the "FileName" variable has the been mapped with the actual custom name of the file which you wanted to send to the OSB.
Now this will send the data to the OSB as a header section.The important point to note down is that we are passing the values using headers and not SOAP action.This is all the change that you need to do in SOA side.
Now in OSB when you create a proxy service you have to do following things
Select get All headers options in OSB
Next while publishing it to end system , Use transport headers and select Name as fileName and in action select "Pass Header through individually". Save all the changes and complete the wizard.
now test your service you should be able to see the transport header getting passed from SOA to OSB
No comments:
Post a Comment