BizTalk Server Tutorial

BizTalk Server Concepts and Common Errors

Calling Restful Services using Itinerary in BizTalk 2013

In the previous post, I showed how to call Restful services using dynamic send ports.

In this post, I am going to leverage that concept to make a Rest Service call using Itinerary.

1. In order to call a restful service using dynamic send port, three main context values should be available in the message. These are
• VariablePropertyMapping
• HttpMethodAndUrl
• SuppressMessageBodyForHttpVerbs

2. These values can’t be promoted using any out of box components in Itinerary. Hence I created a custom pipeline component, that promotes these three values to context. I am using this custom component on my Receive Side -> Decode Stage.

On the high level, below is how the pipeline component code will be.
1

3. I created a Receive pipeline with my custom pipeline component (to promote the 3 main values) + ESB Components to select the itinerary & dispatcher.

2

When I applied this pipeline, my required fields for Restful call & ESB itinerary will be available in the context of the message before it is published to the message box.
4. I started working on creating an itinerary. But Itinerary routing resolver doesn’t provide WebHttp Transport Name.

3

Hence I started creating a Custom Adapter Provider extending from “WCFBaseAdapterProvider”. Below are the contents of the class.

4

I then Gac’ed the assembly and added the details of this transport name in esb.config file. (It will be C:\Program Files (x86)\Microsoft BizTalk ESB Toolkit 2.2\esb.config)

Under Adapter providers, I added the new dll details like below.
5

5. After the above changes to esb.config file, I am able to see WebHttp Transport type.

6

6. I created a simple Itinerary like below.

7

For the static Resolver, below is how I set the Url & Transport type.

8

7. Quick Summary:
• I used a custom pipeline component to promote my required operation & variable mapping on the Receive Pipeline.
• Since, I don’t see WebHttp transport name, I created a custom adapter type & updated esb.config file.
• I used a static Resolver & Provided Transport Location & Transport Name.
8. That’s it. I am done. Once a message is received, my custom pipeline component will write the operation & variable mapping to context. ESB itinerary will be loaded. Itinerary will set the Transport Type as WCF-WebHttp & Transport url to the configured value. This message is then submitted to a Dynamic Send Port. Response from dynamic Send Port is routed back to the Request Response Receive port.

I am not sure if this is a perfect way of doing. But it solved my problem.

HTH
– Shiv

November 12, 2013 - Posted by | ESB | , , , ,

1 Comment »

  1. […] override string AdapterName { get { return “WCF-WebHttp”; } } } You can see my other post or more […]

    Pingback by Part 4: Adding new Adapters to ESB Itinerary « BizTalk Server Tutorial | December 18, 2014 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: