users@jax-rpc.java.net

Re: Creating swaRef attachments in a JAXRPC client

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Fri, 17 Dec 2004 21:24:46 -0800

Your code snippet looks ok. The attachment should have been added as a
MIME part. How are you checking the SOAP message? you might try to print
the entire soap message including the mime part from the client or
server side handler.

-vivek.

mohit.saigal_at_us.abb.com wrote:

>
> Need some help, i am trying to attach a file in a JAXRPC client using
> a swaRef. However, only the swaRef gets set in the SOAP message
> but no attachment is set. Here is the snippet of the code:
> "...
> String imageName = "duke.jpg";
> java.awt.Image newPhoto = getImage(imageName);
> AttachmentPart att =
> MessageFactory.newInstance().createMessage().createAttachmentPart();
> att.setContentId("<" + imageName + ">");
> att.setContent(newPhoto,"image/jpeg");
> ArrayList list = new ArrayList();
> list.add(att);
> stub._setProperty(StubPropertyConstants.SET_ATTACHMENT_PROPERTY,
> list);
> java.net.URI uriName = new java.net.URI("cid:" + imageName);
> String resultResponse = stub.submitActionXF(uriName);
> ..."
>
> AM i missing something here, since there is no message context to deal
> in the clients, i have
> set the "SET_ATTACHMENT_PROPERTY" and added the Collection of
> attachments in the setProperty method.
>
> Anything else ...
>
> Thanks,
>
> Mohit


-- 
Vivek Pandey
Web Services Standards and Technologies
Sun Microsystems Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net