Re: How to get an attachment of a SOAP reques in a jsr181 component?

2006-10-31 Thread JUANI

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.



Re: How to get an attachment of a SOAP reques in a jsr181 component?

2006-10-30 Thread Guillaume Nodet

What's the problem ? ServiceMix is completely agnostic about
the content of binary attachments.  Do you have an exception ?

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


I have got that. FINALLY!!! Now I am in another deal. I can send txt files
from my web application to Service Mix, but when I try to do exactly the
same but with .DOC files I can not do that. So I am having a new question:
How can I send a DOC file as an attachment in a SOAP request?


Thanks.

JUAN

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





--
Cheers,
Guillaume Nodet


Re: How to get an attachment of a SOAP reques in a jsr181 component?

2006-10-30 Thread JUANI

I have got that. FINALLY!!! Now I am in another deal. I can send txt files
from my web application to Service Mix, but when I try to do exactly the
same but with .DOC files I can not do that. So I am having a new question:
How can I send a DOC file as an attachment in a SOAP request?


Thanks.

JUAN

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