[jboss-user] [JBoss Web Services] - Retrieve SOAPMessage from WrappedMessageContext using SOAPMessageContextImpl, in JBoss 6.1

António Ribeiro do-not-reply at jboss.com
Tue Aug 7 08:52:28 EDT 2012

António Ribeiro [https://community.jboss.org/people/while_true] created the discussion

"Retrieve SOAPMessage from WrappedMessageContext using SOAPMessageContextImpl, in JBoss 6.1"

To view the discussion, visit: https://community.jboss.org/message/752382#752382

Hey guys,

I don't know if the subject of the discussion is clear enough but I'll do my best to explain what is happening.

I've a web service deployed into JBoss 6.1 and I'm trying to retrieve the SOAPMessage (javax.xml.ws) from my WebServiceContext (javax.xml.ws).

private WebServiceContext wsctx;

The thing is that, in JBoss 6.1, we no longer are able to do what, for instance, one could do in JBoss 5.1. In JBoss 5.1, to attain the SOAPMessage we could do the following:

SOAPMessageContext msgContext = (SOAPMessageContext) wsctx.getMessageContext();
SOAPMessage soapMessage = msgContext.getMessage();

Now, in JBoss 6.1, the +SOAPMessageContext+ is no longer support hence, and according to what is available throughout the Web, one has to do the following:

WrappedMessageContext wmc = (WrappedMessageContext) wsctx.getMessageContext();
Message message = wmc.getWrappedMessage();
SOAPMessageContextImpl smci = new SOAPMessageContextImpl(message);
SOAPMessage soapMessage = smci.getMessage();

The problem is that, when doing +smci.getMessage();+ it is returned a +*org.w3c.dom.DOMException*+ saying +*WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.*+

Can you please enlighten me in what I'm doing wrong?

Grateful for your attention.

Best regards

Reply to this message by going to Community

Start a new discussion in JBoss Web Services at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120807/41b9e6b0/attachment.html 

More information about the jboss-user mailing list