To effectively call WebService (WS) from BizTalk (BT), you have perform couple of steps. I'm going to list one of the scenarios, where you call WS from orchestration and you need to pass parameters along as well. To make this work, do following:
1) Add WebRefernce to your BT project
2) In the orchestration, add new port and select existing port type (select appropriate WS port in the "Web Port Types" at the bottom. You can either specify now or later.
3) Add Send and Receive shapes to your orchestration
4) Add 2 messages to the orchestration (msgRequest, msgResponse). The message types are in "Web Message Types" - just select appropriate for your method call and request/response.
5) Connect the send/receive shapes with appropriate methods on the port.
This sounds simple enough, but now you have create the request and populate with parameters. This can get tricky, depending on whether you're using primitive types (int, string, etc.) for parameters or complex types. Here is excellent description.
I would only add that in case you work with primitive types and want to simply assign values from some other message, you need to make sure that the fields you want to use are distinguished (otherwise you'll not see them on the message when you "." it)!
Finally, when you deploy, you'll have to create physical port in BT (unless you used "specify now" option). You need to create Send Port, type "SOAP", Send/Receive pipelines are "PassThruTransmit". In the "Configure" section, put the ASMX link to the URL. Note that you can specify authentication there as well, which may be very handy if your WS doesn't allow anonymous access.
Should any errors occur, you'll find them in the Event Viewer - also check for suspended (dehydrated) orchestrations in the BT admin console.
Thursday, July 19, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment