How do I convert Multipart Message to Text Message

Posted by nweddle on 05-Dec-2007 08:59

I want to hand off a text message instead of a multipart message to the client systems that are subscribing to a queue in Sonic. I don't want the client developers to write code to look though all the parts for the message.

Thanks!

All Replies

Posted by dmillman on 07-Dec-2007 05:24

Nathan,

In the last step of your ESB process delete all the parts except the required part from the message. When the ESB sees a single part message the client will receive the text or similar message.

Posted by nweddle on 07-Dec-2007 07:51

Hi David,

I placed a custom service in my ESB Process right before I send the message to the endpoint(Which is a queue). Here is the code I am using to remove the parts and add the message. The result of this was a multipart message with 4 parts. Looks like the parts are:

1. Business Process Properties

2. Itenerary SOAP message

3. My message

4. Something Binary

What am I doing wrong? I did this in the WorkBench BTW.

for (int i=0; i

XQPart prt = msg.getPart(i);

String xmlMessage = prt.getContent().toString();

String processedXml = stripNonValidXMLCharacters(xmlMessage);

prt.setContent(processedXml, "text/xml");

msg.removeAllParts();

msg.addPartAt(prt, i);

}

Posted by Admin on 20-May-2008 11:51

Posted by nweddle on 20-May-2008 13:34

Hi David,

A sample would be great, thanks!

I was able to determine why I was getting a multipart message, even after removing all parts but one. When using an Endpoint Step, the message is automatically converted to a multipart message. The ESB Process is question had Endpoint Steps(with no Exit Endpoint) as the last step in the process. When I used an Exit Endpoint at the end of my ESB Process, my XML Message type was preserved.

Hopefully this will help others at some point.

Nathan

Posted by Admin on 21-May-2008 08:18

Posted by Admin on 21-Aug-2008 23:01

Hello

My process use out-of the box XML transformation service as last step in process. Transformed output is sent to xxx.Exit endpoint which is Queue. In my xsl I am setting method='XML'. Still the client receiving the message on this Queue is getting Multipart Message, any idea?

This thread is closed