In this article I am going to explain about posting a message to BizTalk Server using REST API (Web API). In this case, I am using Advanced Rest Client extension (from Google chrome) to post a message to BizTalk. You can post any PDF, XML, CSV, EXCEL, WORD or any other document to BizTalk. To kick start this we need to follow the steps below:
  1. Create Receive Port (Create a receive location)
  2. Create Send Port (Create subscription)
  3. Test the solution 

Create Receive Port

In this step we will create a receive location to receive messages using WCF-Custom adapter which in turn uses webHttpBinding to expose this receive location to the external world using REST API.
  • Create a one-way static receive Port in BizTalk Admin Console with OneWayGenericRcv as its name.

Create Send Port

In this step we will create a subscription to subscribe messages posted on the receive location created above and route them to a file folder.

  • Create a one-way static send port with name OneWayGenericSend as shown in the screenshot below:

  • Create a filter condition on this send port in order to create subscription for the messages received from the receive location created in step and route them to file folder location.

Test the solution

Send any message to BizTalk server using any REST client in this scenario I am using Google Chrome’s Advanced REST client extension. To post message open the chrome extension and set the properties as shown below:

  • Url: http://localhost/WebAPI/MyTestLocation
  • Verb: POST
  • Raw Message: <your message here>
  • Content Type: <Your Content type> (here I have selected as application/xml as I am sending xml message to BizTalk Server)

Finally, click on the send button.

Check the status code 200 ok as shown in the screenshot below:

Verify the message in File folder

See Also

Another important place to find an extensive amount of BizTalk related articles is the TechNet Wiki itself. The best entry point is BizTalk Server Resources on the TechNet Wiki.