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/\”>
This also has been provided by MSDN here.