Add cookie to service callout using the OSB

It might be possible that you want to send a cookie along with a service callout. You can add a Transport Header action to your callout to add a header but I found out that you can’t just input a String in there. You have to insert a cookie-values fragment. You can accomplish it by doing this.

First insert you Transport Header.

Next select the ‘Add header’ button and select ‘http’ and ‘Cookie’. Now select the ‘Set header to’ radiobutton and input a variable here for example. Mine is called NatCookie here. But how should your variable look like? The XML should look like this:

<http:cookie-values>
<http:value>{data($MyCookie}</http:value>
</http:cookie-values>

If you execute the service call you can see it filled the cookie filled with your value in the $outbound:

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.