How to consume a web service that has three methods

Posted: June 12, 2010  |  Categories: BizTalk Uncategorized

The following question was asked in a newsgroup recently;

“I have a service I have to consume. It has 3 methods. All 3 take in a “Object” defined in the data contract all 3 pass out a generic “Response” also defined in the data contract. The logic to call these methods are exactly the same, and which one is called is determined further up my process. What i don’t want to do is have the call to all 3 methods in the same orchestration in a decide shape, because i have to duplicate stuff and that one orchestration becomes huge and messy. i also don’t want a separate orchestration for each method call because tho this is cleaner, i have to duplicate even more stuff. What i want to know is, can i have ONE orchestration that constructs the Object (i have a map that does this already) and somehow dynamically build my service messages and inject in “Object” then assign dynamically to the correct port operation ….”

Here is how I did a similar thing in another project.

Set up the send port without anything in the SOAP action header.

In the orchestration use a decision shape to determine which method is called.

In each branch of the decision shape assign the BTS.Action property in CopyMethod2WCFAction as shown below;

maintainContactRequest(WCF.Action) = http://LeadsManagement.Schemas.QuoteService_v1.0/IQuoteService/ + internalMaintainQuoteRequest.Method;

See http://msdn.microsoft.com/en-us/library/bb743856(v=BTS.20).aspx for a reference.

turbo360

Back to Top