Adding SOAP Header in BizTalk..

When you are working with orchestration we can use property schema to handle the SOAP header in Biztalk.

These are the simple steps you can follow as guidance :

  • Make sure your web reference to web service has been updated.
  • Open Reference.xsd from the wsdl of the web service. It should define how the SOAP header constructed. And this the example :<soap:Header><Header><SessionId>12345</Sessionid></Header> </soap:Header>
  • Took the root of the element from the SOAP header which is Header.
  • Create the property schema and name it as SOAPHeader.xsd. I have tried using different names but it is not working so I suggest you to use this name.
  • Set the target namespace of the schema become http://schemas.microsoft.com/BizTalk/2003/SOAPHeader
  • Add an element to property schema, in this case Header
  • Change Property Schema Bae to MessageContextPropertyBase
  • Save the file.

Now you are ready to use the SOAP header in biztalk. You can use it in construction message before sending it to port or on expression after receiving message from port. You can access the SOAP header by this simple code :

SampleMessage(MyNamespace.Header) = “<ns0:Header xmlns:ns0=\”http://www.somewebaddress.com/\”>
<ns0:SessioId>MyName</ns0:Sessionid>
</ns0:Header>”;

This also has been provided by MSDN here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s