Subscribing Multipart messages

I want to publish a multipart message to Meassagebox and based on filter i would like to retrieve any part of the messages.

I am publishing the schema as webservice,

Any article or sample available ,

Regards

Suresh

January 28th, 2015 3:09pm

I want to publish a multipart message to Meassagebox and based on filter i would like to retrieve any part of the messages.

I'm not able to understand the BOLD part of the statement.

In a Multi-Part message, ONE (and ONLY ONE) part is the designated BODY. The schema associated with this part is what the subscription can contain.

Once the subscriber gets the message they can then extract the rest of the message parts and do whatever.

Regards.

Free Windows Admin Tool Kit Click here and download it now
January 28th, 2015 3:26pm

Assume i had exposed three different schema as webservice  and i would publish it to message box and i can subscribe any  messges  based on the filter.

But now i need to create a multi part message for holding the three different schema and later i should be able to subscribe to any of the message part . Can it be done this way . Please advice

January 28th, 2015 3:42pm

Hi,

The namespace and root node of the body of the multipart message can be used for subscription. However do keep in mind when you publish this message you should subscribe to all parts. Here is a good blog post on the same

Free Windows Admin Tool Kit Click here and download it now
January 28th, 2015 3:53pm

Hi Suresh,

You sound confused.

Understand that in an orchestration you can create a message out of four "things" -

  • A .net class - in which case the class is the type behind the message
  • A schema - in which case the xsd is the type behind the message
  • A multi-part message type - in which case you are required to declare the type first in the types section of the orchestration view pane.
  • A web part - in which case a multi-part message type has been created for you when you've added a web reference.

While all four options follow on the type-instance approach, which keeps the statement that an orchestration is a strongly typed environment correct.

The big question: What is the Message Type for a BizTalk Multipart Message?

The message type for a BizTalk message is identified with the BTS.MessageType property. For a multipart message, it would be the message part with the property 'Message Body Part' = 'true'.

But now i need to create a multi part message for holding the three different schema and later i should be able to subscribe to any of the message part --

This is not the implementation of Multipart message.

Refer: Subscriptions and multi-part messages

Alternate solution for you:

Receiving Multiple Message Formats in a Single Orchestration

Configuring BizTalk Orchestrations to handle un-typed messages

Rachit

January 28th, 2015 3:55pm

Exposing a schema with multiple roots results in multiple operations. This is NOT a multipart message.

What you want is a single operation that can accept multiple messages. The way to do this is to publish a service where the message type is XmlDocument and use the XMLReceive pipeline on the service receive.

Then in the background you can have multiple (direct bound two-way port) orchestrations where you can set a specific message filter.

But when someone consumes the Web Service (WSDL) they will not get the message schemas. You will have to provide the request/response combinations separately to consumers of your service.

Regards.

Free Windows Admin Tool Kit Click here and download it now
January 28th, 2015 4:18pm

Assume i had exposed three different schema as webservice  and i would publish it to message box and i can subscribe any  messges  based on the filter.

Sure, this normal BizTalk processing, nothing special about handling the messages.
But now i need to create a multi part message for holding the three different schema and later i should be able to subscribe to any of the message part . Can it be done this way . Please advice
Yes, it can be done quite easily but this suggests you will be receiving the individual messages using a Convoy then creating the MPM on you own. After that you can set and subscribe on any Properties you want. Then in the receiving Orchestration, access which ever Part you want.
January 28th, 2015 4:51pm

Johns - I won't be receiving the 3 messages one by one . I would be receiving all in one single message and later publish to message box..later any of the subscribers can subscribe to any part of the messages.
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2015 7:31pm

Youre just guessing. Why dont you quickly spin up a visual studio and try your speculations. You will know.

There are so many speculation on your replies..

Assume i had exposed three different schema as webservice  and i would publish it to message box and i can subscribe any  messges  based on the filter  -

. I would be receiving all in one single message and later publish to message box..

This would never occur. Only way to exposed three different schema as webservice  (I assume one web service) is by creating multiple operation in a web service and each operation has different schemas associated with its request.  So when you publish a message to any of these web service operation, this would result as a separate message into msgbox db. Not all 3 messages would be published as one message.

multi-part is not for your requirement. This would not work for you.

You have some options:

You would be receiving one message comprising all 3 messages, still you will have one root element or one message type in a formatted XML message. Something like this:

<ns0:MessagesFromWebService xmlns:ns0="http://YourNamespace">
  <Message1>
    <ID>ID_0</ID>
    <Name>Name_0</Name>
  </Message1>
  <Message2>
    <ID>ID_0</ID>
    <Name>Name_0</Name>
  </Message2>
  <Message3>
    <ID>ID_0</ID>
    <Name>Name_0</Name>
  </Message3>
</ns0:MessagesFromWebService>

Above is just an example message. So in this case the message type if http://YourNamespace#MessagesFromWebService.

You your subscription can be based on the above message type.

You will not receive message like the following. This is not valid XML message.

<ns0:Message1 xmlns:ns0="http://YourNamespace">
  <ID>ID_0</ID>
  <Name>Name_0</Name>
</ns0:Message1>
<ns0:Message2 xmlns:ns0="http://YourNamespace">
  <ID>ID_0</ID>
  <Name>Name_0</Name>
</ns0:Message2>
<ns0:Message3 xmlns:ns0="http://YourNamespace">
  <ID>ID_0</ID>
  <Name>Name_0</Name>
</ns0:Message3>

  • Otherwise, you would receive 3 different messages. If you want to process them in a single orchestration, use convoy.
  • Other options: if you want to create a generic orchestration to process message from your service.

Create a canonical map which transforms the message received to a common/canonical format in inbound map of the Receive port. So in this way, in your in inbound map of the Receive port which gets the message from web service you will have 3 maps:

  1. Message1 to Canonical message
  2. Message2 to Canonical message
  3. Message3 to Canonical message

Have a orchestration which subscribe to the above constructed Canonical message

January 28th, 2015 8:44pm

Johns - I won't be receiving the 3 messages one by one . I would be receiving all in one single message and later publish to message box..later any of the subscribers can subscribe to any part of the messages.

But that is not how a BizTalk app would work without you specifically implementing an aggregation pattern.

The only out-of-the-box way to receive an MPM without coding it is through POP3 or MIME encoded streams.

Free Windows Admin Tool Kit Click here and download it now
January 29th, 2015 4:02am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics