users@glassfish.java.net

Sending Attachments to a JAX-WS Web Service

From: <glassfish_at_javadesktop.org>
Date: Sun, 03 Jun 2007 10:50:02 PDT

I'm trying to send an attachment to a web service endpoint created via JAX-WS.

I am using the example in the following URL to guide me: http://www.nabble.com/Soap-With-Attachments-t3567874.html

Unfortunately I an not able to send the attachment successfully, when attempting to get the attachment , I am receiving an empty Map where the map containing attachments should be:

[code]
MessageContext context = wsContext.getMessageContext();
Map attachments = (Map) context.get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
[/code]

I am completely new to web services, however one thing I noticed from the example is that the map with attachments is placed into a "requestContext" in the client, but retrieved from a "messageContext" in the endpoint. Is this the way it should be or should the client somehow place the attachments in the message context?

Could anybody please help me figure out how to go about this?

Thanks,
Eraser
[Message sent by forum member 'eraser' (eraser)]

http://forums.java.net/jive/thread.jspa?messageID=220263