[ https://issues.apache.org/jira/browse/CXF-1511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783718#action_12783718 ]
Lalit Kapoor edited comment on CXF-1511 at 11/30/09 4:11 PM: ------------------------------------------------------------- The following is a way to get to the soap message (in accordance with what Alessio Soldano said above), hope it helps: import javax.xml.ws.WebServiceContext; import javax.xml.soap.SOAPMessage; import javax.xml.soap.SOAPHeader; import javax.xml.soap.SOAPException; import org.apache.cxf.jaxws.context.WrappedMessageContext; import org.apache.cxf.jaxws.handler.soap.SOAPMessageContextImpl; import org.apache.cxf.message.Message; ... @Resource public WebServiceContext context; WrappedMessageContext wmc = (WrappedMessageContext)context.getMessageContext(); Message msg = wmc.getWrappedMessage(); SOAPMessageContextImpl smci = new SOAPMessageContextImpl(msg); try { //To get the headers SOAPMessage soapMsg = smci.getMessage(); SOAPHeader header = soapMsg.getSOAPHeaders(); } catch (SOAPException e) { e.printStackTrace(); } was (Author: idefine): The following is a way to get to the soap message (in accordance with what Alessio Soldano said above), hope it helps: import javax.xml.WebServiceContext; import javax.xml.soap.SOAPMessage; import javax.xml.soap.SOAPHeader; import javax.xml.soap.SOAPException; import org.apache.cxf.jaxws.context.WrappedMessageContext; import org.apache.cxf.jaxws.handler.soap.SOAPMessageContextImpl; import org.apache.cxf.message.Message; ... @Resource public WebServiceContext context; WrappedMessageContext wmc = (WrappedMessageContext)context.getMessageContext(); Message msg = wmc.getWrappedMessage(); SOAPMessageContextImpl smci = new SOAPMessageContextImpl(msg); try { //To get the headers SOAPMessage soapMsg = smci.getMessage(); SOAPHeader header = soapMsg.getSOAPHeaders(); } catch (SOAPException e) { e.printStackTrace(); } > WrappedMessageContext does not implement SOAPMessageContext > ----------------------------------------------------------- > > Key: CXF-1511 > URL: https://issues.apache.org/jira/browse/CXF-1511 > Project: CXF > Issue Type: Sub-task > Components: JAX-WS Runtime > Reporter: Thomas Diesler > Assignee: Alessio Soldano > Fix For: Invalid > > > [tdies...@tddell trunk]$ ant -Dtest=jaxws/binding test > tests-run-internal: > [junit] Running org.jboss.test.ws.jaxws.binding.SOAPBindingTestCase > [junit] Retrieving document at 'http://localhost:8080/jaxws-binding?wsdl'. > [junit] Tests run: 2, Failures: 1, Errors: 1, Time elapsed: 6.716 sec > [junit] Test org.jboss.test.ws.jaxws.binding.SOAPBindingTestCase FAILED -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.