#IoT2CRM: Alternatives for the gateway – Dive into BizTalk – part 3

Yay.. Today I installed BizTalk 2013 R2 (just to be sure) and made some good progress. In the previous article I ran into a massive wall. Now I figured out why and I’ll explain to you where I went wrong.

It started all with the URL I was passing into BizTalk:

http://dev-bvdsande.devzone.local:8080/iot2crm/service1.svc/?deviceId=rpi&deviceType=11&errorCode=xx&errorMessage=oops

I configured BizTalk to listen to a POST message and I was sending the message using as a POST. One would say the URL looks ugly but perfectly fine. On a normal API controller it would have been working like a charm, on BizTalk I broke two rules *WUT?*

When you send a POST message to BizTalk, BizTalk expects to receive a message body. I was sending my information as a query string and that is a big “No No”!
As a rule of thumb, an empty message body, will always result in an empty message. Period!
Furthermore it turns out that BizTalk is not too keep about using the ampersand in an incoming url. There are workarounds available, but for me these are too complex.

As I mentioned before, my goal is to build a no code solution in BizTalk. I realize that in my case that won’t be possible, unless I spend some money on the Roedl BizTalk to CRM adapter. For the second half of this proof of concept, I’m going to implement a small custom adapter to connect BizTalk to CRM.

Configure incoming message

For now I’ll focus on receiving the message into BizTalk.

When we open up the BizTalk Administration Console, we navigate to our receive location. The receive location should be configured like this:

Btreceive1

By setting the pipeline to PassThruReceive, BizTalk won’t touch the incoming message when received.

Click the Configure button, and ensure the settings look like this:

Btreceive2

Compared to the previous article, you see that the Operation in the Xml fragment became much more clean.

When you send a message using Postman, you can specify the JSON message you want to pass in. As I want to register a malfunction, I send in the following fragment.

Postman

Sending this message results in a filled XML message, processed by the send port we configured.

Notepad

Mission accomplished

Now we are able to save the message, we will take our scenario to the next level. In the next article I’m going to replace the FILE adapter in the send port with a custom CRM adapter. That will be the only part that I cannot configure out of the box. Visual Studio will be my weapon of choice  .

Leave a Reply

Your email address will not be published. Required fields are marked *