You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Matthew T Whittaker <mw...@us.ibm.com> on 2004/08/09 00:02:07 UTC
add attachment to response using rpc
I am using SOAP RPC and want to add a attachment using MIME to the
response. I ask for the SOAPContext as the first parameter and add a
MIMEBodyPart to this but it is not working. Is this the Response
SOAPContext? How do I get this? Is it possible to add a MIME attachment
to the Response using RPC or do I need to use Message?
Regards,
Matthew T Whittaker
IT Professional
IBM Global Services
Phone: 781-323-5147
Internet: mwhitt@us.ibm.com
Re: add attachment to response using rpc
Posted by Scott Nichol <sn...@scottnichol.com>.
You refer to the problem with returning attachments from RPC: you can access the request SOAPContext, but not the response. For RPC services, the response SOAPContext is not available.
The only way to return attachments from RPC services is using the method return value. For example, if the method returns a DataHandler or InputStream, the return value in the SOAP Body will reference an attachment. Returning a DataHandler[] allows multiple attachments. Returning an bean for which a property is a DataHandler would also put an attachment in the response.
Scott Nichol
Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message -----
From: "Matthew T Whittaker" <mw...@us.ibm.com>
To: <so...@ws.apache.org>
Sent: Sunday, August 08, 2004 6:02 PM
Subject: add attachment to response using rpc
>
>
>
>
>
> I am using SOAP RPC and want to add a attachment using MIME to the
> response. I ask for the SOAPContext as the first parameter and add a
> MIMEBodyPart to this but it is not working. Is this the Response
> SOAPContext? How do I get this? Is it possible to add a MIME attachment
> to the Response using RPC or do I need to use Message?
>
> Regards,
>
> Matthew T Whittaker
> IT Professional
> IBM Global Services
> Phone: 781-323-5147
> Internet: mwhitt@us.ibm.com
>
>