Re: Send Attachment with SAAJ

2005-10-26 Thread Olivier Mocquais RD-BIZZ

MOCQUAIS Olivier RD-BIZZ wrote:


Hi,

I want to send an attachment a file with SAAJ (in the server side).

org.apache.axis.MessageContext context = 
org.apache.axis.MessageContext.getCurrentContext();

javax.xml.soap.SOAPMessage message = context.getResponseMessage();
javax.xml.soap.AttachmentPart ap = message.createAttachmentPart();
ap.setContent(XXX, application/xml);
message.addAttachmentPart(ap);

It works, but it uses the org.apache.axis.MessageContext class and the 
getResponseMessage() and getCurrentContext() methods.


And I don't want to use this class and I want to use classes from 
specification (SAAJ or JAX-RPC).


How can I do this ?

Thanks.

Olivier


I have read some documentations about SAAJ, and I found this lines: (it 
creates a new SOAP Message)

SOAPConnectionFactory spConFactory =SOAPConnectionFactory.newInstance();
SOAPConnection con = spConFactory.createConnection();
SOAPFactory soapFactory = SOAPFactory.newInstance();
SOAPMessage message = factory.createMessage();

But how can I send this new message to Axis ?


Send Attachment with SAAJ

2005-10-25 Thread Olivier Mocquais RD-BIZZ

Hi,

I want to send an attachment a file with SAAJ (in the server side).

org.apache.axis.MessageContext context = 
org.apache.axis.MessageContext.getCurrentContext();

javax.xml.soap.SOAPMessage message = context.getResponseMessage();
javax.xml.soap.AttachmentPart ap = message.createAttachmentPart();
ap.setContent(XXX, application/xml);
message.addAttachmentPart(ap);

It works, but it uses the org.apache.axis.MessageContext class and the 
getResponseMessage() and getCurrentContext() methods.


And I don't want to use this class and I want to use classes from 
specification (SAAJ or JAX-RPC).


How can I do this ?

Thanks.

Olivier