Biztalk multiple continuous calls to webservices - biztalk

Here is the problem:
Biztalk application should get data from webservice into two steps:
1.Request list of changed clients GetChangedClients(date) and receive list in format:
<clients>
<client id='C1'>
<client id='C2'>
....
<client id='CN'>
</clients>
2.After receiving list of clients Biztalk will issue one call per client like
getChanges("C1")
getChanges("C2")
....
getChanges("CN")
3.After changes messages received they will be passed to WCF-port.
Question:
What would be the best way to build this into biztalk
(building orchestration with a loop, call component to create multiple messages with clientid, create custom adapter ) ?

I think that the scatter-gatherer pattern would work well for this. In your orchestration split the clients xml document into individual client messages, then publish these to a orchestration that handles them along with a correlation token. The orchestration that does the individual calls and sends the response back to the controlling orchestration. An example can be found at http://www.richardhallgren.com/a-loosely-coupled-scatter-and-gather-implementation-in-biztalk-2006/
Another place for an example of this is at http://blogs.msdn.com/b/cvidotto/archive/2006/12/18/biztalk-server-2006-code-samples-awesome.aspx. Search for Implementing Scatter and Gather Pattern.

One of the simplest way to this, is to use Partner Direct Ports in BizTalk.

Related

How to use BizTalk Server to forward an existing SOAP WebService?

I am new to BizTalk development. I have an existing SOAP web service, which has around 50 different operations. I want to connect this service to another application, but use the BizTalk server as an intermediary in this communication. So service and application should not know each other directly, BizTalk should be able to log all messages going through etc etc.
What is the best approach to make this work in BizTalk Server 2013?
So far I tried to create a new BizTalk Application and import the SOAP web service there. Then however it seems that I need to create around 50 different orchestrations, each one just mapping the incoming message in BizTalk to the external service for each service operation. This seems very cumbersome. Also publishing all those orchestrations becomes painful, as BizTalk cannot merge those into a single endpoint again. Ideally I would like to publish a single endpoint for BizTalk server on IIS that is using the exact same WSDL as the target SOAP service, ideally without having to create any orchestrations at all. Is this possible?
Thanks!
So, yes, but...what you want is absolutely doable but there would be lots of answers for that. Once you learn how things in BizTalk are actually working, it's obvious how to do this.
For example, a single Receive Location (IIS endpoint) can receive any number of request types provided they are the same protocol/format, SOAP, REST/JSON for example. The only difference in the IIS site is any metadata, so just don't publish that. The Message differentiation is done in the Pipelines just like any other BizTalk Message.
You don't really need Orchestrations for Maps, you can apply those at the Port Level provided it's a 1-1 relationship between the SOAP call and Map.
Please try a few things. I'll become clear. You can always come back for any specific issues.

Biztalk ESB itinerary combine data source

I am struggling to transfer my data in my itinerary in my Biztalk ESB solution, I'm using Message-based instead of Orchestration. My itinerary scenario in Biztalk ESB is:
Receive request CreatePayment with 2 parameters: Claim Object and
Payment Object
Send Claim Object to external service to Verify Claim
Receive result from step 2, then combine the result with Payment Object in request at step 1, then send it to external service to Create Task
My problem is at step 3, I don't know how to combine data from 2 resources. Is there any knowledge that I missing in Biztalk ESB. I just started learning Biztalk for a few weeks. Now I got trouble and I really wait for feedback from you.
Sorry I have to post my itinerary picture to OneDrive since I cannot post it to this: https://onedrive.live.com/redir?resid=584F1A7DD6FCBF77!961&authkey=!ANQVuaTflyExPTo&v=3&ithint=photo%2cPNG
If you can switch to Orchestration, then setting some unique fields as correlationId will solve your problem.
If you are limited to use Message-based instead of Orchestration. below is 2 possible approach you may try.
If you can control the external service, change it to accept your payment object and return it as-is in its response.
If you cannot change the external service, what you can do is wrap the service such as an external assembly. then call this service in a mapping using script functoid.
Your problem seems like that of an Enrichment Scenario.
Check out the sample provided in ESB Toolkit samples:
https://learn.microsoft.com/en-us/biztalk/esb-toolkit/installing-and-running-the-message-enrichment-sample
You will have to use an Orchestration extender in your itinerary.

ESB Toolkit - No response from web service when using Orchestration Extender

I have the following itinerary:
A one way receive location passes a message to an orchestration where an inner message is extracted (unable to do this in a map).
The returned message from the orchestration is then mapped and the
result of that map, mapped again. Using the Microsoft.Practices.ESB.Services.Transform service.
This is then passed to a web service, via the Microsoft.Practices.ESB.Services.Routing service, which fires fine but I am not receiving the expected response which I want to write to file. The message that does get written to the file is the message passed to the web service rather than the expected response. Testing the web service using a simpler itinerary i.e. one without orchestration extenders shows that the web service works as expected.
The OffRamp is from the GlobalBank.ESB example application.
How can I get the required response from the web service?
So finally managed to find a solution to this for which I have to give full credit to this guy
The problem is Microsoft.Practices.ESB.Services.Routing Service only provides one way operation, so even if you mark your resolver with two-way message exchange pattern it wont work.
If you check Microsoft.Practices.ESB application in BizTalk Admin console, it has one one way dynamic send port Microsoft.Practices.ESB.Agents_2.1.0.0_Microsoft.Practices.ESB.Agents.Delivery_DeliveryPort_31bf3856ad364e35 which is bound to orchestration Microsoft.Practices.ESB.Agents.Delivery. When you use Orchestration extender and use Microsoft.Practices.ESB.Services.Routing service, this port is used to send any call and because this is one way port, you do not get response.
You need to use a Two-way orchestration in callwebservice shape. A sample Two-way orchestration is in MultipleWebServices ESB Sample. If you deploy that orchestration and register it as itinerary service and use it in callwebservice shape, it will work.
and it more or less did :) Deploy the orchestration and register it to the ESB as an itinerary service by adding an entry to the esb config between the itineraryServices node:
<itineraryService id="04BD6120-06E4-43D3-A56F-2FF061D59862" name="ESB.MultipleWebServices.Orchestrations.TwoWayRouting" type="ESB.MultipleWebServices.Orchestrations.TwoWayRouting, Biztalk.EsbGeneric.Orchestrations, Version=1.0.0.0, Culture=neutral, PublicKeyToken=140bc5dcbb9afcea" scope="Orchestration" stage="None"/>
Create an id using guidgen, the type is made up of the name and assembly of the orchestraiton (comma seperated) in the Admin Console and will vary depending on the application that you have deployed to. scope and stage are as shown above.
Initially I had an error on the send port Biztalk.HoopleEsbGeneric.Orchestrations_1.0.0.0_ESB.MultipleWebServices.Orchestrations.TwoWayRouting_RoutingPort_140bc5dcbb9afcea but changing the send and receive pipelines to PassThruTransmit and PassThruReceive respectively solved this.

Biztalk client defined subscription items

I am designing a Biztalk solution which requires client applications to subscribe and receive only a certain subset of event messages depending on their user permissions. Subscription will be done through topic or content based routing. The client will subscribe once and receive many messages until they choose to unsubscribe.
Client applications will number in the 100s and subscribed topics could change on a regular basis, so defining an individual send port from Biztalk for each reciever isn't a viable solution.
I have thought I could build an additional message broker service which holds the individual client subscriptions and distributes messages sent from a biztalk port.
I have also seen that a recipient list pattern can be build using orchestrations. This appears to me to still follow a request-response pattern though and I am after 1 way subscribe message to many returned event messages.
My message broker solution seems to me to be doubling up on what Biztalk should be good at so I imagine I am missing some important functionality somewhere. Has anyone tried such an application before and can give some pointers? Should I be investingating the ESB toolkit as a solution? I have had a look on the net but nothing makes it very clear for this type of topic-subscription model.
Thanks,
Phil
Do take a look at the ESB Toolkit. You can use the itinerary functionality that it adds to BizTalk, either with one of the built-in resolvers (e.g., UDDI) or with your own custom resolver. This allows you to route messages based on configuration (stored in Business Rules or elsewhere).
You will find a developer-oriented overview video of the ESB Toolkit on MSDN, which is a decent introduction to the design process and tooling. There are several other helpful videos there as well.
Your specific scenario can accomplished with a single itinerary, as described here. Use a receive pipeline with the ESB Dispatch Disassembler component, configure multiple resolvers, and for each resolver a new message is produced.
There are also two samples to look at:
The Itinerary On-Ramp Sample - builds a set of SOAP headers that contain the itinerary that you create in the test client, loads the specific message file from disk, appends the itinerary headers to the message, and submits it to the ESB through an Itinerary on-ramp for processing.
The Scatter-Gather Sample - Also appends SOAP headers containing the itinerary to the message, which is submitted to the ESB through an on-ramp for processing. A Broker orchestration analyzes the settings for its itinerary step, retrieves a collection of resolvers associated with the itinerary step, and for each of those resolvers resolves the service endpoint. After that, the orchestration activates the proper ServiceDispatcher orchestration instances to dispatch the outbound request messages.
You should also look at "How to: Route a Single Message to Multiple Recipients Using an Itinerary Routing Slip" or perhaps look into creating a custom itinerary message service (documentation is here).

What is the recommended way to split messages in send pipelines?

I need to split a bizTalk message in the send pipeline. This is easy with disassemblers in receive pipelines, but doesn't work in send pipelines (makes sense).
So what is the recommended way to do it? The only easy way to do it is to write the outbound message to file, then reprocess it using a receive pipeline with a disassembler, and then send the generated messages through a outbound pipeline. Honestly, I don't need the additional roundtrip through the message box, but I don't want to create a custom send adapter.
Any other suggestions? Any easy way to save messages with multiple parts using the ootb file adapter?
While your solution is probably the best approach for this, you can also think about splitting the message inside of an orchestration (not the best practice) before the message even hits the send pipeline. The send pipeline is obviously designed for composition of messages and not decomposition so I would stay away from any custom code to handle this.
Here's a good article on debatching messages.
Why don't you use receive pipeline to split the messages at the first place. Anyways your solution uses receive pipeline. You don't want to write outbound message to file system and process it using receive pipeline again.

Resources