Correlation in BizTalk - biztalk

I have 2 orchestrations in my project and 2 schemas (the first is for request, the second is for response).
Orchestration 1 has a Receive shape (Activating=true). It receives a request and then routes it to Orchestration 2. The latter constructs a request to a web service, which responds with a response, waits 2 min and then sends a new request to my BizTalk service. Both projects use the same schemas, a Request and a Response schemas.
Orchestration 2 uses a correlation set which is initialized in a Send shape that sends a request to the web service. Also, Orchestration 2 has a Receive shape waiting for a message with the correlation set previously in the Send shape.
Here is the sequence diagram:
And there is the Orchestration 2:
Send_1 and Receive_2 shapes have correlation properties set up.
The problem is when a webservice sends request2 (see the diagram above) to my biztalk service, it throws an error saying "The message found multiple request response subscriptions. A message can only be routed to a single request response subscription." How that can be if I've set the correlation? I expected request2 to be routed to the Orchestration 2 because it has a receiver with correlation.

The error message is correct.
When a Request is sent from the WebService, it is routed to the Activation Receive Shape of Orchestration2.
But because the correlation is in effect, this creates an additional subscription which is why the request is also expected to be routed to the third Receive shape in Orchestration2.
If you cannot distinguish the Request schemas, you must use an additionnal condition for activating Orchestration2. You can, for instance, filter the Request that comes from the Orchestration1 with extra filters based upon context properties.
You'll observe that one Request comes from an WCF or SOAP Adapter while the first one does not.

Related

Solicit-response send port and pipelines in BizTalk

My question is regarding the send and receive pipelines in a single solicit-response send port. Is it possible the receive pipeline (response part) can access information from the send pipeline?
Out of the box no, as per Access promoted property in the response message context on Request-Response port
So you have the following options
Orchestration. You can retain the value of the request here and add it to any response going back to whichever calling system.
Have the system that is sending the response to BizTalk include that value in a field, then you can just promote that.
Custom Pipeline Components that use some sort of static dictionary to store any values from the Request, then populate the Response.

WSO2 AM - Calling web service for enrichment from an out sequence

This is what I try to solve:
Proxy in-sequence receives a request message and passes it to backend service
Proxy out-sequence receives the response message and iterates over each returned item
Call another service for each item and enrich the original message with some parts of the result from the second service
Return the enriched result from proxy to caller
What will be the proper mediators to use in this scenario?
This is a case of service chaining, where you can use the mediators iterate and aggregate
In this link, you can find a similar case.
http://dakshithar.blogspot.com/2012/07/routing-and-service-chaining-with-wso2_23.html

failed response from web service for child orch

I am using a scatter-gather pattern to call a webservice:
I am receiving an envelope message.
I am debatching an envelope message by executing an xml pipeline in orchestration.
calling a child orchestration for each debatched message using start orchestration and self-correlating port.
calling a web service for each debatched message in my child orchestration and returning the response to the caller.
aggregate the response message and sent it back to the user.
My question is there any way so that if my child orchestration failed for even one of the debatched message i get the error response and send it to the user without continuing any further process.
Yes, but using the Start Orchestration Shape makes it challenging.
One relatively easy way would be to still return the correct MessageType to the Scatter Orchestration, but with a Context Property indicating an Error occurred.
You'd then have to check this property on each returned message. After checking all the Gathered messages, decide what to do.

How to publish an any element from envelop schema to MessageBox

I have an envelope message (EM), in this EM there some elements which are promoted on the context (for routing) and there is one Any element (called Payload) holding the actual schema instance for further use (other orchestrations are subscribing to that Payload instance).
This is a generic service (WCF, request-response) receiving the request message, returning a response message (having some elements of the request and with a new generated unique transaction ID) and a fault message (when applicable).
The Payload must be published on the MessageBox (direct binding) with some of context properties of the EM.
How can this be done most effectivly ?
Do you know about how to process envelope schemas using an xml disassembler component inside a receive pipeline? It is not clear from your question if you have tried this or not or if this is even the challenge you are facing.
If not then read here: http://msdn.microsoft.com/en-us/library/aa546772(v=BTS.20).aspx
Can I just confirm
WCF client sends a message matching the Envelope Schema
You wish to debatch the Envelope Schema into one or more Payload messages contained inside for the Payload processing orchestration.
? Do you need to wait until all Payload messages are processed until you respond back to the WCF client with a success / fail response (i.e. the response is dependent on the completion of the Payload messages).
If you don't need point 3) then your WCF orchestration can just send a 'yes' message back to the WCF client without worrying about what happens to your payload.
The standard XMLReceive on your WCF Receive location should be able to debatch the message automagically as long as it recognises it as an Envelope schema, i.e. contains
<b:schemaInfo is_envelope="yes" xmlns:b="somexmlns"/>
<b:recordInfo body_xpath="xpathtoroot"/>
However, if you do need point 3 a problem I can see is that because you are using WCF request-response, is that the client is going to want a synchronous response back depending on the Payload processing. It would be difficult to do this using the standard envelope debatching as you would need to correlate the progress and results of your payload processing back to your WCF orch - instead, you might just keep your outer (Envelope) schema as non-envelope, and use a custom receive pipeline in your WCF orch to split out the messages and then loop through each and call your payload processing Orchestration.
http://mstecharchitect.blogspot.com/2008/12/debatching-biztalk-xml-messages.html

Biztalk, need to consume a web service

What I need to do to send a request and to receive answer from the Web Service that I want to consume.
What i have done:
I have done the "add web Reference"
I added a Send Shape and a Receive Shape and a I configured a port that sent and received with web Type, the port binding Specify later and I connect with the Request and response to the Send and Receive shape.
I believe I am missing something ?
From your description I am guessing you might be missing -
A definition of the request and
response messages; you need to
ensure you have a request and
response message defined, with their
types being the generated web types.
Select the correct message for both
the send and receive shape. send
shape uses the request message,
receive shape uses the response
message.
Construct the request message using a construct and a transform or assignment shape before the send shape. the easiest way to get started is to use a map in a transform shape to create the request from whatever message triggered your process, but the exact implementation detail will, of course, depend on your scenario
This should be enough to call the service I would have thought
There are many blog posts on the subject, here's one I found with a quick search that shows all the pieces needed
I'm currently working my way through a project using Biztalk to consume a web service. I think you may have a error when compiling similar to :
"Use of unreconstructed message"
If this is the problem, add a construct message shape to the orchestration before the send to the web service port.
I'm stuck with creating the message syntax but this should get you moving.

Resources