You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by "Jesus M. Salvo Jr." <je...@migasia.com> on 2003/01/16 08:18:38 UTC

Bug? Root element of a SOAP message must be: 'http://schemas.xmlsoap.org/soap/envelope/:Envelope'.

Apache-SOAP ( as a client ) is throwing the following exception when 
receiving the SOAP response ( also generated by Apache-SOAP ) from the 
HTTP response body:

java.lang.IllegalArgumentException: Root element of a SOAP message must 
be: 'http://schemas.xmlsoap.org/soap/envelope/:Envelope'.

It is being thrown from within Envelope.unmarshall() ( line 306 ) with 
the following code:

    this.logger.info( "Sending Submit SOAP message to " + p_postTo );
    soapMessage.send( p_postTo, actionURI, envelope );
    this.logger.info( "Submit SOAP message sent" );

    // Retrieve the response back
    this.logger.debug( "Getting SubmitResponse...." );
    SOAPTransport transport = soapMessage.getSOAPTransport();
    BufferedReader reader = transport.receive();

    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    InputSource source = new InputSource( reader );
    Document xmlResponseDocument = builder.parse( source );

    Envelope responseEnvelope = Envelope.unmarshall( 
xmlResponseDocument.getDocumentElement(), responseContext );
    return responseEnvelope;


Here is the SOAP response and the HTTP headers  taken out from a sniffer:

HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=0816C93B2D6652ECB59393C32BC9C596; Path=/soap
Content-Type: text/xml
Content-Length: 649
Date: Thu, 16 Jan 2003 07:07:29 GMT
Server: Apache Coyote/1.0
Connection: close

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Header>
    <mm7:TransactionID 
xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-0">123</mm7:TransactionID>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
    <mm7:SubmitReq 
xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-0">
    <MM7Version>5.4.0</MM7Version>
    <Status>
        <StatusCode/>
        <StatusText/>
        <StatusDetails/>
    </Status>
    </mm7:SubmitReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>



-- 
Jesus M. Salvo Jr.
Mobile Internet Group Pty Ltd
(formerly Softgame International Pty Ltd)
M: +61 409 126699
T: +61 2 94604777
F: +61 2 94603677

PGP Public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC0BA5348



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Bug? Root element of a SOAP message must be: 'http://schemas.xmlsoap.org/soap/envelope/:Envelope'.

Posted by "Jesus M. Salvo Jr." <je...@migasia.com>.
Just to pre-empt some replies:

On the client side: I am using JAXP with Xerces 2.2.1, with Xerces 2.2.1 
on front of the CLASSPATH


Jesus M. Salvo Jr. wrote:

>
> Apache-SOAP ( as a client ) is throwing the following exception when 
> receiving the SOAP response ( also generated by Apache-SOAP ) from the 
> HTTP response body:
>
> java.lang.IllegalArgumentException: Root element of a SOAP message 
> must be: 'http://schemas.xmlsoap.org/soap/envelope/:Envelope'.
>
> It is being thrown from within Envelope.unmarshall() ( line 306 ) with 
> the following code:
>
>    this.logger.info( "Sending Submit SOAP message to " + p_postTo );
>    soapMessage.send( p_postTo, actionURI, envelope );
>    this.logger.info( "Submit SOAP message sent" );
>
>    // Retrieve the response back
>    this.logger.debug( "Getting SubmitResponse...." );
>    SOAPTransport transport = soapMessage.getSOAPTransport();
>    BufferedReader reader = transport.receive();
>
>    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
>    DocumentBuilder builder = factory.newDocumentBuilder();
>    InputSource source = new InputSource( reader );
>    Document xmlResponseDocument = builder.parse( source );
>
>    Envelope responseEnvelope = Envelope.unmarshall( 
> xmlResponseDocument.getDocumentElement(), responseContext );
>    return responseEnvelope;
>
>
> Here is the SOAP response and the HTTP headers  taken out from a sniffer:
>
> HTTP/1.1 200 OK
> Set-Cookie: JSESSIONID=0816C93B2D6652ECB59393C32BC9C596; Path=/soap
> Content-Type: text/xml
> Content-Length: 649
> Date: Thu, 16 Jan 2003 07:07:29 GMT
> Server: Apache Coyote/1.0
> Connection: close
>
> <?xml version='1.0' encoding='UTF-8'?>
> <SOAP-ENV:Envelope 
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <SOAP-ENV:Header>
>    <mm7:TransactionID 
> xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-0">123</mm7:TransactionID> 
>
> </SOAP-ENV:Header>
> <SOAP-ENV:Body>
>    <mm7:SubmitReq 
> xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-0"> 
>
>    <MM7Version>5.4.0</MM7Version>
>    <Status>
>        <StatusCode/>
>        <StatusText/>
>        <StatusDetails/>
>    </Status>
>    </mm7:SubmitReq>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
>
>


-- 
Jesus M. Salvo Jr.
Mobile Internet Group Pty Ltd
(formerly Softgame International Pty Ltd)
M: +61 409 126699
T: +61 2 94604777
F: +61 2 94603677

PGP Public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC0BA5348



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Bug? Root element of a SOAP message must be: 'http://schemas.xmlsoap.org/soap/envelope/:Envelope'.

Posted by "Jesus M. Salvo Jr." <je...@migasia.com>.
Just to pre-empt some replies:

On the client side: I am using JAXP with Xerces 2.2.1, with Xerces 2.2.1 
on front of the CLASSPATH


Jesus M. Salvo Jr. wrote:

>
> Apache-SOAP ( as a client ) is throwing the following exception when 
> receiving the SOAP response ( also generated by Apache-SOAP ) from the 
> HTTP response body:
>
> java.lang.IllegalArgumentException: Root element of a SOAP message 
> must be: 'http://schemas.xmlsoap.org/soap/envelope/:Envelope'.
>
> It is being thrown from within Envelope.unmarshall() ( line 306 ) with 
> the following code:
>
>    this.logger.info( "Sending Submit SOAP message to " + p_postTo );
>    soapMessage.send( p_postTo, actionURI, envelope );
>    this.logger.info( "Submit SOAP message sent" );
>
>    // Retrieve the response back
>    this.logger.debug( "Getting SubmitResponse...." );
>    SOAPTransport transport = soapMessage.getSOAPTransport();
>    BufferedReader reader = transport.receive();
>
>    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
>    DocumentBuilder builder = factory.newDocumentBuilder();
>    InputSource source = new InputSource( reader );
>    Document xmlResponseDocument = builder.parse( source );
>
>    Envelope responseEnvelope = Envelope.unmarshall( 
> xmlResponseDocument.getDocumentElement(), responseContext );
>    return responseEnvelope;
>
>
> Here is the SOAP response and the HTTP headers  taken out from a sniffer:
>
> HTTP/1.1 200 OK
> Set-Cookie: JSESSIONID=0816C93B2D6652ECB59393C32BC9C596; Path=/soap
> Content-Type: text/xml
> Content-Length: 649
> Date: Thu, 16 Jan 2003 07:07:29 GMT
> Server: Apache Coyote/1.0
> Connection: close
>
> <?xml version='1.0' encoding='UTF-8'?>
> <SOAP-ENV:Envelope 
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <SOAP-ENV:Header>
>    <mm7:TransactionID 
> xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-0">123</mm7:TransactionID> 
>
> </SOAP-ENV:Header>
> <SOAP-ENV:Body>
>    <mm7:SubmitReq 
> xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-0"> 
>
>    <MM7Version>5.4.0</MM7Version>
>    <Status>
>        <StatusCode/>
>        <StatusText/>
>        <StatusDetails/>
>    </Status>
>    </mm7:SubmitReq>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
>
>


-- 
Jesus M. Salvo Jr.
Mobile Internet Group Pty Ltd
(formerly Softgame International Pty Ltd)
M: +61 409 126699
T: +61 2 94604777
F: +61 2 94603677

PGP Public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC0BA5348