Like

Welcome On Mobius

Mobius was created by professionnal coders and passionate people.

We made all the best only for you, to enjoy great features and design quality. Mobius was build in order to reach a pixel perfect layout.

Mobius includes exclusive features such as the Themeone Slider, Themeone Shorcode Generator and Mobius Grid Generator.

Our Skills

WordPress90%
Design/Graphics75%
HTML/CSS/jQuery100%
Support/Updates80%

Adding Custom HTTP Headers to messages send via HTTP Adapter

By Muhammad Omer 9 years ago
custom-http-headers-to-messages-send-via-http-adapter

There will often be times we need to add some custom HTTP Headers to our outgoing message. The common one we come across is SOAPAction, if you need to communicate with the web services just with HTTP adaptercustom-http-headers-to-messages-send-via-http-adapter (not using SOAP Adapter).

BizTalk server gives us a context property called “UserHttpHeader” as part of the HTTP adapter, which can be used to set custom HTTP headers.

The below Orchestration shows an example, how you can take advantage of “UserHttpHeader” property.

The code inside the “Message Assignment” shape is shown below:

MSG_AUTHOR_OUT = MSG_AUTHOR_IN;
MSG_AUTHOR_OUT(*) = MSG_AUTHOR_IN(*);
MSG_AUTHOR_OUT(HTTP.UserHttpHeaders) = “userName: helloworld\r\npassword: world”;

Important things to note:

  1. You can add multiple headers (ex: userName, password) in a single line as shown in the sample above.
  2. \r\n” is used to separate multiple headers.
  3. : ” is used to separate header and value, you must specify a SPACE after colon.

The content of the output file is shown below

POST http://…………………………………………./1.1
Connection: Keep-Alive
Content-Length: 312
Content-Type: text/xml; charset=utf-16
Expect: 100-continue
Host: localhost:3131
User-Agent: Microsoft (R) BizTalk (R) Server 2010

userName: helloworld
password: world

<?xml version=”1.0″ encoding=”utf-16″?><<stripped content for clarity>>

Categories:
  Biztalk, Technology
this post was shared 0 times
 000
About

 Muhammad Omer

  (148 articles)

Muhammad Omer is the founding partner at Allied Consultants. Areas of interest for him are entreprenuership in organizations, IT Management, Integration and Business Intelligence.