Geeks With Blogs
Evan Koch Musings on BizTalk Server and SQL Server

Sometimes when developing orchestrations in BizTalk it can be useful to be able to communicate with web services.  For this example I’ll be calling a web service to generate a MIN for a loan based on the organizationID and sequence number that are passed in as parameters.  Below is the definition for the web method:

The incoming message that activates the orchestration will contain the organizationID and the sequence number.  An example of the input message is provided below.

To communicate with the web service, we’ll need to add a web reference to the project that contains the MINGenerator web service. 

If the method includes something other than primitive data types, there will also be a Reference.xsd file under  After adding this reference, we’ll be able to create messages to communicate with the web service defining the type as a Web Message and choosing the appropriate schema.

These values will be used to create the request message that is passed into the web service.
When working with this type of message, all of the values within the message are considered to be distinguished and you have to create the message within a Message Assignment shape – you can’t define a Transform to create the message because you can’t select the desired schema as a destination schema.
To define a port to communicate with the web service, you’ll need to create a configured port within the orchestration.  Be sure to select the existing Port Type option and find the appropriate definition under Web Port Type.

Below is a screenshot of the orchestration. 

We first receive a MIN request, create a MINGeneratorRequest using the values from the initial request, and communicate with the web service.  We receive a response from the web service that contains the new MIN and use this value to create a new message 

Source code for this example can be found here.

Posted on Wednesday, September 26, 2007 2:25 PM | Back to top

Comments on this post: Consumimg Web Services in BizTalk

# re: Consumimg Web Services in BizTalk
Requesting Gravatar...
Nice post. This is by far the easiest way to call a web service... if you can get it to work. Sometimes if you use a web reference you will see a bug where the orch will build the fine the first time, and then refuse to compile when you try to build it again, complaining that the string and int web service parameters are not serializable. Basically, you have to restart Studio every time that you want to build. If you see this Studio bug, you can work around it by building the web service schema by hand. You can also use the WSE adapter, which has a nice schema generation wizard which works most of the time. Microsoft recommends using the WSE adapter instead of the SOAP adapter as a best practice anyway.
Left by Russell Waltz on Oct 21, 2007 9:01 AM

# re: Consumimg Web Services in BizTalk
Requesting Gravatar...
Thak`s for this post, it help me for my work
Left by Alejandro Fernandez on Apr 28, 2011 4:39 AM

Your comment:
 (will show your gravatar)

Copyright © Evan Koch | Powered by: