You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by "Edwards, Jayme" <JC...@software.rockwell.com> on 2000/07/10 22:37:54 UTC

Problem with using Envelope class

Hello,

I'm using the Apache/IBM SOAP implementation to parse SOAP messages sent from various clients, including those that do not use the org.apache.soap client API. For instance I have one simple page in which a user can enter the SOAP action, headers, target URI, and type in manually the request body and have it sent to an endpoint for processing. For instance, I may send a call like this:

<SOAP-ENV:Envelope 
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
    <myns:callMethod xmlns:myns="http://www.someurl.com">
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

On the server I have a servlet I have written that verifies the appropriate content-type and headers needed for SOAP (yes, I know there is a servlet/jsp that does this, I need to write my own due to certain requirements) and then passes it to the Envelope class for unmarshaling.

e.g:

InputSource inputSource = getSAXInputSourceFromHTTPRequestSomewhere();
DOMParser parser = new DOMParser();
parser.parse(inputSource);
Document myDocument = parser.getDocument();
Envelope soapEnv = Envelope.unmarshall(myDocument.getDocumentElement());

I've tried sending several SOAP calls simply to get verification that the envelope is being unmarshalled correctly, every time I get the error:

Root element of SOAP messages must match
http://schemas.xmlsoap.org/soap/envelope/:Envelope

I've tried leaving the trailing slash off the SOAP namespace (as per the spec), omitting the call inside the SOAP-ENV:Body and using the default namespace (instead of mapping to SOAP-ENV). Any idea what I'm doing wrong?

Jayme