users@jax-rpc.java.net

Creating swaRef attachments in a JAXRPC client

From: <mohit.saigal_at_us.abb.com>
Date: Fri, 17 Dec 2004 16:12:55 -0800

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