BizTalk Server 2004 : B2B, EAI and .NET

Tuesday, August 31, 2004

Sending Messages as FORM Variables with the HTTP Adapter

Here's a quickie. If you want to send a message, as a FORM Variable in a HTTP request, this is what you do:

1) Set the Content Type property of the HTTP send port, to application/x-www-form-urlencoded.

2) Create a custom pipeline and plug-in a Custom Pipeline Component, that pre-pends Variable-Name= in front of the message, and url encode it. e.g: ClaimPacket=

3) Use this pipeline with your HTTP send port, and you are done!

Post a comment for a sample.

Update : Screen shot of the Content Type property:

7 Comments:

  • Thanks, I was struggling with that.

    By Anonymous Anonymous, on September 20, 2004 4:49 PM  

  • I can't find the ContentType property on the HTTP send port. Could someone walk me through it?

    By Anonymous JT, on March 17, 2005 8:56 AM  

  • Hey JT,

    Added a screen shot of the location of the ContentType property. Hope that helps.

    By Blogger Devdutt, on March 18, 2005 4:21 PM  

  • Dev,

    Thank you SO MUCH for having this post available. I am very thankful to you for sending me a custom pipeline component. After unsuccessfully using FixMsg from the SDK, your component saved the day! FixMsg was putting some chars between the prepend and the actual message that was causing the post to fail. Your component worked beautifully. Not only that, but it was so straightforward that I was able to easily modify it to accept additional parameters for the post variables.

    Your timeliness and continued responses to me during this effort are truly appreciated. You are an asset to the development community.

    I've bookmarked you as a "favorite". Keep the posts coming!

    Michael

    By Anonymous Michael, on March 31, 2005 11:06 AM  

  • This looks great! Could I get a copy of the Pipeline component used in your example.

    Thanks,
    Matt

    By Blogger mcable, on April 06, 2005 3:25 AM  

  • Sure thing. Here ya go.

    By Blogger Devdutt, on April 06, 2005 12:12 PM  

  • This is absolutely what I need to do as I have to prepend QUERY= to the front of an xml document before HTTP POSTing it out.

    Thanks for the 'Heads-Up', you've saved me some serious time here.

    I was going to start out with FixMsg as well but I noticed Michael's comments. Would it be possible to also get a copy of your Pipeline component?

    Keep 'em coming...

    By Anonymous Simon, on October 28, 2005 2:17 PM  

Post a Comment