[jboss-user] [JBoss Web Services Users] - Question about SOAPMessage

oechevarria do-not-reply at jboss.com
Fri Nov 6 16:17:06 EST 2009

Hi all,

I installed and ran the test suite for jbossws-native-3.2.0.GA.  Everything worked OK.  Then using Eclipse I ran and debugged the tests in the org.jboss.test.ws.jaxws.samples.provider package.  Everything OK again.
Then I modified  ProviderBeanMessage.java to look like this (just the modified part):

public SOAPMessage invoke(SOAPMessage request)
	SOAPPart soapPart = request.getSOAPPart();
	try {
	SOAPEnvelope envelope =soapPart.getEnvelope();
	SOAPBody body = envelope.getBody();
	SOAPHeader header = envelope.getHeader();
	Source source = soapPart.getContent();
	} catch (SOAPException e) {
	// TODO Auto-generated catch block
      return request;

I also modified ProviderMessageTestCase.java to enhance the test String to look like this
   private String msgString =
      "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" +
      "  <soap:Body>" +
      "    <ns1:somePayload xmlns:ns1='http://org.jboss.ws/provider'/>" +
      "<ns1:addcall xmlns:ns1='http://org.jboss.ws/provider'>" +
      "<ns1:addImport xmlns:ns1='http://org.jboss.ws/provider'>" +
         "<ns1:ImportCalcCalculator xmlns:ns1='http://org.jboss.ws/provider'>" +
            "<ns1:Num2 xmlns:ns1='http://org.jboss.ws/provider'>?</ns1:Num2>" +
            "<ns1:Num1 xmlns:ns1='http://org.jboss.ws/provider'>?</ns1:Num1>" +
         "</ns1:ImportCalcCalculator>" +
      "</ns1:addImport>" +
      "</ns1:addcall>" +
      "  </soap:Body>" +

I rebuilt and ran everything again and when I looked at the contents of the incoming request in the Bean I noticed that element ns1:addImport and its children are not visible or present in the message structure.  So the line Source source = soapPart.getContent(); 
returns an invalid object.

If I inspect the response back in testProviderDispatch() and testProviderMessage() (in ProviderMessageTestCase.java) the entire message is there.

So the question is: why is that when the message arrives on the server side it is missing a portion of its contents?
Any thoughts or comments are greatly appreciated


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264389#4264389

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264389

More information about the jboss-user mailing list