![]() |
Enterprise Systems »
Microsoft BizTalk Server »
General
Beginner
Calling a Web Service with Custom Parameters from an Orchestration in BizTalk Server 2004By Naveen KaramchettiThis article describes how to invoke a Web Service which has custom parameters from a BizTalk Orchestration. |
Windows, .NET, Visual Studio, Dev
|
||||||||||
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
It is generally very straight forward to invoke a Web Service from an BizTalk Orchestration. In some special cases, a Web service returns or accepts an object. In such cases a custom map is required to send a request to the web service. We shall consider a case where an object is returned from a web service and how this is handled in BizTalk.
Consider a simple scenario where some information about an Employee is required within an orchestration. This employee infomation is provided by some web service, which takes in a EmployeeInput object as a input parameter and returns a EmployeeOutput object. Notice that both the input and output parameters to the web service are objects, and not simple .NET types.
Let us have a quick look at the input and output schemas...
This is very simple schema with EmployeeCode element.
The output schema contains all the elements related to the employee information.
In this project we are using two maps,
The parallel branch in this orchestration shall invoke the Web Service and perform the Transformation simultaneously.
Setting the parameters required to invoke the Web Service
WSParamEmployeeInput.EmployeeCode = EmployeeIn.EmployeeCode; WSRequest.employeeInput = WSParamEmployeeInput; System.Diagnostics.EventLog.WriteEntry("Transformation", "EmployeeIn -> WSRequest");
Assigning the EmployeeOut message into a temporary variable.
TempEmployeeOut = EmployeeOut; System.Diagnostics.EventLog.WriteEntry("Transformation", "Employee In to EmployeeOut");
Assigning the data obtained from the Web Service to the EmployeeOut message.
EmployeeOut = TempEmployeeOut; EmployeeOut.EmployeeCity = WSResponse.RetrieveEmployeeResult.EmployeeCity; EmployeeOut.EmployeeName = WSResponse.RetrieveEmployeeResult.EmployeeName; EmployeeOut.EmployeeDept = WSResponse.RetrieveEmployeeResult.EmployeeDept; EmployeeOut.EmployeeEmail =WSResponse.RetrieveEmployeeResult.EmployeeEmail;
List of various messages used in the Orchestration...

Notice the input file data. The EmployeeCode is filled up.

Observe the various artifacts in the Solution Explorer.

The output XML file has all the information about the Employee.
WSParamDemo.zip with the folder names in the C:\drive.
EmployeeInfoService.zip with the folder names in the C:\inetpub\wwwroot drive and setup the Web Service Application through Internet Services Manager.
KeyAndBindings contains the Bindings.xml file, which can be imported after the solution is built and deployed.
EmployeeRequest_1.xml in the In folder and observe the Event log to find out the various events generated, and finally observe the Out folder for the output XML file. | You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 19 Apr 2006 Editor: |
Copyright 2006 by Naveen Karamchetti Everything else Copyright © CodeProject, 1999-2009 Web10 | Advertise on the Code Project |