Monday, March 2, 2009

How to send SOAP headers in BizTalk 2004/2006

Here are the steps to set SOAP headers in a web service request using BizTalk Server 2004/2006(BTS).

1. Make sure your web reference in your BTS project is up to date.

2. Open the Reference.xsd for the wsdl of the web service. Look for the name of the root node for their Soap Header. Here is the example I'm using...



string
string




3. Copy the name. Close the file.

4. Create a new item for the BTS project. Select "Property Schema" NOT the regular schema.
- In the properties for ,
Change the target NameSpace to http://schemas.microsoft.com/BizTalk/2003/SOAPHeader
- In the properties for the root node,
Rename the root node the same as the one is step 2 ("AuthenticationHeader")
Change the Property Schema Base drop-down to "MessageContextPropertyBase"

5. Save the file as "SoapHeader.xsd" and Close the file. (Update: It doesn't matter what the name is as long as the TYPE NAME property of the xsd file is not the same as the root node name. Otherwise, you'll run into a compilation error)


more..... click here