The problem may come from the SAAJMarshaler...

For routing, you could use a Content Based Router
(http://servicemix.goopen.org/site/servicemix-eip.html#servicemix-eip-ContentBasedrouter).
Currently, only xpath-predicate are supported, but it should be easy to
write new ones to check for properties on the message if needed.


On 10/31/06, JUANI <[EMAIL PROTECTED]> wrote:

Hi,
  The problem is that I have to do differently if I am dealing with .txt or
.doc, in the SOAP request. Now I can send both, but Servicemix gives me an
error when I try to get the information from the message.

WEB APPLICATION CODE

if (fi.getName().endsWith(".doc")) {
               String strMimeType = "multipart/*";
               javax.activation.MimetypesFileTypeMap map =new
javax.activation.MimetypesFileTypeMap();
               map.addMimeTypes(strMimeType);
               javax.activation.FileTypeMap.setDefaultFileTypeMap( map );
        MyDataSource myds=new MyDataSource();
        myds.setBuffer(ba);

        dh = new DataHandler(myds);
        type=strMimeType;

}else {
                   type="text/plain";
                   dh = new DataHandler(new String(ba), type );

}

AttachmentPart attachment = smsg.createAttachmentPart(dh);
attachment.setContentId("binary");
attachment.setContentType(type);

smsg.addAttachmentPart(attachment);

SERVICEMIX CODE:

    SaajMarshaler marshaler = new SaajMarshaler();

    SOAPMessage inMessage =
marshaler.createSOAPMessage(exchange.getMessage("in"));

------------------------------
  I am now having troubles also with the routing engine. Suppose I am having
a java bean in a component. I would like to send the JBI message to one
component(service) depending on a var value, or send the same JBI message to
any other if the value is different. How could I do that?

How can I choose where to send my messages depending on some internal var
values?

THX





--
View this message in context: 
http://www.nabble.com/How-to-get-an-attachment-of-a-SOAP-reques-in-a-jsr181-component--tf2502337.html#a7090450
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.




--
Cheers,
Guillaume Nodet

Reply via email to