SAAJ response - invalid SOAP envelope
From: Stephen Chell (stevecnz2_at_yahoo.com)
Date: 04/04/04
- Next message: Ryan Stewart: "Re: Applet help"
- Previous message: atptour: "Applet help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 4 Apr 2004 14:49:49 -0700
I'm using SAAJ 1.2 (from jwsdp-1.3) and JDK 1.4.2_03.
I've written a client application that uses the SAAJ api to send a
SOAP message to a servlet. The servlet successfully receives the
message and returns a SOAP response containing a single element in the
SOAP body. The client receives the response and writes its content to
standard out via the SOAPMessage.writeTo() method. The response
received looks correct:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<eai:Response xmlns:eai="urn:nz:govt:eai">SUCCESS</eai:Response>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
... but when I try to access the soap envelope as follows:
SOAPMessage response = connection.call(message, endpoint);
response.writeTo(System.out);
SOAPPart part = response.getSOAPPart();
SOAPEnvelope env = part.getEnvelope();
The last line in the above code fragment throws the following
exception (see below). Does anyone know whats causing this? Please
help.
Thanks in advance ...
Steve
SEVERE: SAAJ0511: Unable to create envelope from given source
com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create
envelope from given source:
at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:71)
at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:34)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:82)
at test.SendDogLicense.main(SendDogLicense.java:124)
Caused by: javax.xml.transform.TransformerException:
org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create
or change an object in a way which is incorrect with regard to
namespaces.
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:511)
at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:63)
... 3 more
Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made
to create or change an object in a way which is incorrect with regard
to namespaces.
at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:354)
at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)
at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:494)
... 4 more
- Next message: Ryan Stewart: "Re: Applet help"
- Previous message: atptour: "Applet help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|