Sorry, the example shows *receiving* an attachment.  The only ways to return an 
attachment are (1) use the messaging API on the server or (2) return a DataHandler 
from the method.

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: "Scott Nichol" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 17, 2004 6:48 PM
Subject: Re: SOAP with attachment


That is what the code below shows, how to return an attachment from the server.

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: "Ying Ying" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 17, 2004 6:11 PM
Subject: Re: SOAP with attachment


Hi Scott,

If I wanna the server to return the attachment (still as a MimeBodyPart),
how could I add it to the response message?


Thanks,
ying


----- Original Message -----
From: "Scott Nichol" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 11, 2004 10:26 PM
Subject: Re: SOAP with attachment


For an RPC service where the attachment is not referenced by a parameter,
you would insert a first parameter of type SOAPContext in the service
method.

For example, if your method is currently

    void MyMethod(void) {...}

change it to

    void MyMethod(SOAPContext ctx) {
        MimeBodyPart bp = ctx.getBodyPart(1);
        ...
    }

You change nothing on the client, i.e. do *not* attempt to send a
SOAPContext parameter.

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: "Ying Ying" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 11, 2004 5:10 PM
Subject: SOAP with attachment


Hi all,

If I add attachment like this:

Call call = new Call();
MimeBodyPart bp = new MimeBodyPart();
....
call.addBodyPart(bp);

call.invoke(......)

How can I access the MimeBodyPart on the server-side?

All the best,
ying








Reply via email to