You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Christopher Johnson <jo...@gmail.com> on 2010/12/03 21:44:03 UTC

Soap With Attachments

All -

I have a web service that needs to send attachments back, but it's not clear
how to get the response message context to add attachments to before I
return.

I've looked in the samples provided with Axis2 but did not see an echo
service or an example that did that.

Could someone please provide a short code snippet on how to add attachments
to the response message.

Thanks in advance,

..Chris

Re: Soap With Attachments

Posted by Christopher Johnson <jo...@gmail.com>.
I think I found it:

   MessageContext inMessageContext = MessageContext.getCurrentMessageContext();
   OperationContext operationContext = inMessageContext.getOperationContext();
   MessageContext outMessageContext = operationContext

.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);



On Fri, Dec 3, 2010 at 3:44 PM, Christopher Johnson <jo...@gmail.com>wrote:

> All -
>
> I have a web service that needs to send attachments back, but it's not
> clear how to get the response message context to add attachments to before I
> return.
>
> I've looked in the samples provided with Axis2 but did not see an echo
> service or an example that did that.
>
> Could someone please provide a short code snippet on how to add attachments
> to the response message.
>
> Thanks in advance,
>
> ..Chris
>