Custom SOAP headers with the BizTalk SOAP adapter

I recently had to add a custom SOAP header to a request sent to a web serivce from BizTalk, and had to research how to do it.
  1. Add a property schema and change target namespace to http://schemas.microsoft.com/BizTalk/2003/SOAPHeader.
  2. Add an element to this schema with the name of the custom header (in my case "CustomCredentials") and Property Schema Base = MessageContextPropertyBase.
  3. In orchestration, in a message assignment shape, assign the content of the header to the property, e.g.:

MessageX(Namespace.CustomCredentials) = "<CustomCredentials xmlns="<namespace>"><Username>foo</Username><Password>bar</Password></CustomCredentials>";

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