Thursday, January 10, 2008

BizTalk Consume WebServices with SOAP Header

When working with Web Services, the common scenario is to pass in the credential in the SOAP Header.

In this post, I will provide the steps how to do this in BizTalk Orchestration.
This will be a simple flow like below screen shot :

Flow Detail :
  1. Web Application will call an exposed web services by Biztalk Orchestration
  2. The request object consists of 3 elements : UserName, Password, Message
  3. BizTalk Orchestration will construct the SOAP Header Message with UserName and Password
  4. BizTalk Orchestration will assign the Message as the body and assign the SOAP Header
  5. BizTalk Orchestration calls the Web Services (WSSOAPHeader)
  6. Web Services will read the SOAP Header message and return back some message
  7. BizTalk will also return back the message to the web application

BizTalk Orchestration layout

One of the most crucial thing in here is the SOAP Header message.
To create the SOAP Header message schema :
  1. Create a property schema file
  2. In the schema properties, change the Target Namespace to http://schemas.microsoft.com/BizTalk/2003/SOAPHeader Set the Node Name property to the SOAP Header Name and the Property Schema Base to MessageContextPropertyBase
After creating this property, we can assign the SOAP Header into the message like this below

varXMLSOAPHeader = msgSOAPHeader;
msgWSRequest(MyBizTalkApp.AuthenticationSOAPHeader) = varXMLSOAPHeader.OuterXml;


Note :
  • When assigning the SOAP Header, it expects string value, that's why I assign the msgSOAPHeader into an XML document variable and get the string from OuterXml property.
  • If the SOAP Header is not received by the web services even though you have assigned it in the code, make sure that you have followed each of the steps to create the SOAP Header message schema above, especially the namespace part. It caused me 2 days to notice this one in the end :P
You can find and download the whole VS 2005 solution at here :


Here is the link to the MSDN Site : Consuming Web Services with SOAP Headers

Hope this helps

12 comments:

  1. Excellent article. However, Link to source code "http://www.mediamax.com/bembengarifin/Hosted/BizTalkSOAPHeader.zip
    " is no longer available. Could you please update it? Alternatively, you can Email me at s_nutulapati@yahoo.com

    Thank you

    ReplyDelete
  2. Thank you so much for putting up such a interesting post on the significance of SOAP API.

    SQL Server Load Soap Api

    ReplyDelete
  3. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing... biztalk training

    ReplyDelete
  4. I think this the best blog with the most important information filled in this website
    I Got the more and more ideas from this blog Thank You for letting us to know.
    pythonTraining in chennai

    python Course in chennai

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Wow, that is appealing studying. i am glad i found this and were given to artifice in it. great task upon this content. I preferred it loads. thanks for the colossal and precise data. Driver Genius Crack

    ReplyDelete

  7. We notice and value your efforts.
    https://easyserialkeys.com/plagiarism-checker-x-crack/

    ReplyDelete
  8. You can use Plagiarism Checker X 2023 Professional Edition Crack to determine whether or not your article is original. By examining any difficulties with duplication in their assignments and papers, Plagiarism Checker X aids pupils.
    "How check plagiarism
    best free plagiarism check
    plagiarism checker xcracked download
    how to check plagiarism free online
    plagiarism checker x crack download
    plagiarism checker x free download full version with crack
    is plagiarism Checker x safe"

    ReplyDelete
  9. This is the best post I have ever seen. Very clear and simple. Mid-portion Is quite interesting though. Keep doing this. I will visit your site again. Kozy Hoodie

    ReplyDelete
  10. This blog post provides a clear explanation of how to pass credentials through SOAP headers in BizTalk Orchestration.

    ReplyDelete
  11. https://www.facebook.com/media/set/?set=a.122104007858890912&type=3
    https://www.facebook.com/media/set/?set=a.122104010774890912&type=3
    https://www.facebook.com/media/set/?set=a.122104011908890912&type=3
    https://www.facebook.com/media/set/?set=a.122104018172890912&type=3
    https://www.facebook.com/media/set/?set=a.122104020902890912&type=3
    https://www.facebook.com/media/set/?set=a.122104023374890912&type=3
    https://www.facebook.com/media/set/?set=a.122104025192890912&type=3
    https://www.facebook.com/media/set/?set=a.122104036760890912&type=3
    https://www.facebook.com/media/set/?set=a.122104026968890912&type=3
    https://www.facebook.com/media/set/?set=a.122104028924890912&type=3

    ReplyDelete