We are basically use GET method or POST method of Rest services to consume by BizTalk. There are other verbs also for REST services, but here we are providing only these two verbs details. We can’t add generated items to create schema, orchestration or binding files for REST service just like as SOAP web service by consuming WSDL file.

So before jump into to configure the send port. You need to first create schema based on the json files and promoted properties if there are parameters in Rest Service URL. For creating schemas from json file click here.

Consume Rest Service with GET Method:

You need to configure one-way/two-ways send port based on rest service to consume by BizTalk

In GET method of REST Service, there is no message body. Information is sending in URL as Parameter as in below example:

here Param1 and Param2 are the two parameters of the GET method. Now We need to understand how BizTalk work with this.

In above screen shot we are defining Variable Mapping (at Send Port). In variable Mapping, we are assigning parameters with Property Schema. We need to define Property Schema variable with Message Context Property. Otherwise it will not assign any value.

Receive the response in json file, you need to first create schema for the response. Click here for how to create schema for json file. And add JSON decoder in Receive Pipeline Decode component. Click here for more details. Create your property schema with those properties, set the Property Schema Base to MessageContextPropertyBase.

Send Port Configuration to consume Rest Service:

  1. In case of when BizTalk is consuming Rest Service through its Send Port with Wcf-WebHttp adopter
  1. then its configuration is same as in Receive Port except one nominal change in below configuration.

<BtsHttpUrlMapping><Operation Name=”” Method=”GET” Url=’/OperationName/Request?Param1={param1}&amp;Param2={param2}’ /></BtsHttpUrlMapping>

  • There is not require providing Operation name, we can leave it blank as above.
  • Promote the elements (Param1 and Param2) from message schema whose elements are going to use in GET API URL. Map the elements with property schema element names and namespace as below.
  • If there is not require any parameter in GET method, then no need to add parameters in BizTalk Schema.

Consume Rest Service with POST Method:

POST Method does not send data in URL Parameters as GET Method sends. In Post method, Rest Service sends data in Message body. Mostly this is in json format. When BizTalk send file, then using JSON encoder pipeline component, BizTalk convert the xml into json format.

For more details for Pipeline configuration related information click here.

Send Port Configuration to consume Rest Service:

At BizTalk Send port configure Adapter type as WCF-WebHttp.

we just adding a below details in HTTP Method and URL mapping in Wcf-WebHttp adopter configuration.

<BtsHttpUrlMapping><Operation Name=”” Method=”<REST METHOD>” Url=’/OperationName’ /></BtsHttpUrlMapping> 

Note: There is not require providing Operation name, we can leave it blank as above.

Here no need to do anything with Variable mapping. Until unless you have parameters in URL just as GET Method.

Apply “Content-Type:application/json” to process data as JSON as below.

Note: Outbound HTTP Headers properties can be applied on GET, POST or others REST Method

One thought on “Rest Service Consume by BizTalk

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s