How to publish an any element from envelop schema to MessageBox - biztalk

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

Related

Better Event centric way to solve request-reply problem in Kafka or any streaming service

I am stuck in a problem while using Kafka in a microservice architecture . I am not able to understand how a microservice handling HTTP requests will be able to send a response to the user. I want to take data from HTTP and then publish it to topic named A then another validator service will validate it and publish it on another topic named B. I want to send processed data to HTTP response from subscribed data from topic B.
In my experience, one option is to respond immediately with 201 accepted, or embed a blocking validator library into your API, and properly return a 400 Bad Request.
Then future GET calls are required to read eventually consistent data that might come back from any consumer. E.g. the consumer process is Kafka Connector that writes to some database, or is a Kafka Streams/KSQL table, future API queries will return data from that. Your original client may need to make periodic HTTP calls until that data is available.

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.

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 return a soap fault with content from an orchestration?

In an orchestration (BizTalk 2010), we receive an xml message, validate the message against a schema, and perform schematron (content) validation as well. Our orchestration is exposed via a WCF service. Our validation routines are able to capture all validation errors, which we want to return via a soap fault containing all the validation errors. Additionally, we want the orchestration to complete normally, even in the case of validation errors (no suspended messages). How can we go about doing this?
If you want to use normal soap fault then then all you need to do is add soap fault message part to the receive port. In your orchestration do the validation and if it fails then construct a soap fault message and send that message instead of the normal result.
You will probably need to do the above within a scope so that you can handle exceptions and let the orchestration terminate gracefully.
See Using SOAP Headers, specifically, SOAP Headers with Published Web Services.

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