Solicit-response send port and pipelines in BizTalk - 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.

Related

WF4 SendReply to Receive in another activity

I'm new to WF4 and was wondering if it was possible to send a reply to a receive activity defined in another workflow?
Once my WCF service receives a request I'm performing an operation in another activity and under certain conditions I want to send a reply to the request from this activity and then pause the workflow for further input. Is it possible to do this?
Thanks!
No that won't work. The Receive and the SendReply need to be linked to each other using an activity correlation handle.
What you can do however is use duplex communications where the second workflow sends a SOAP message to an endpoint with an address passed to it in the first message. Technically these are two separate requests and not related so there are no restrictions.

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

Correlation in 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.

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.

Property promotion not happening in Wcf receive location

I have an "enevelope" schema and a body schema and I have setup the correct properties on the "envelope" to point to the body.
I also have a property schema for promoting a value in the body message so that i can route on it.
I set up a File drop receive location and two send ports. Each send port subscribing on a different value of the promoted property. The receive location uses XmlReceive and the send ports both use XmlTransmit.
When i drop one envelope message at the Rcv location, Bts picks it up, splits it, promotes the property and my send ports pick up the relevant messages and do their thing.
File drop was fine for testing, but the real scenario is slightly different.
I want clients to submit "envelope" schemas containing multiple document elements via Wcf
So i published the envelope schema as a Wcf endpoint using the publishing wizard. Let it create the new Receive location. Wired up a Wcf client to talk to this endpoint and submitted a message.
Without changing anything on the Send ports in BizTalk I expected the same result;
However I now get a routing failure.
If i remove the extra filter in the Send port that filters on the promoted property it works, no routing failure.
So ... it would appear that the promoting of my property is not happening on the Wcf receive location.
I have checked; the Wcf receive location is using XmlReceive.
What gives?
How do i fix this?
I would guess that the namespace of your incoming message has changed as a result of changing it to use WCF.
This can cause the property promotion to no longer match the incoming message.
You can view the property promotions in the tracked messages in the BizTalk server admin tools.

Resources