Skip to Content
0
Former Member
Feb 22, 2006 at 02:53 PM

NestedSOAPException when using StreamSource

14 Views

I am trying to read a SOAP document from a string using the javax.xml.transform.stream.StreamSource:

StringReader sr = new StringReader("<xml....>");

StreamSource source = new StreamSource(sr);

SOAPPart part = soapmessage.getSOAPPart();

part.setContent(source);

But when it reach part.setContent(source) the following exception is received when running under WAS 6.4:

com.sap.engine.services.webservices.jaxm.soap.accessor.NestedSOAPException: Unable to create message from source.

When running the same code in a standalone appl. it does not throw an exception - seems like SAPs xml parser implementation has an error.

Here is the whole stacktrace:

com.sap.engine.services.webservices.jaxm.soap.accessor.NestedSOAPExcept

ion: Unable to create message from source.

at com.sap.engine.services

.webservices.jaxm.soap.SOAPPartImpl.setContent(SOAPPartImpl.java:192)

at com.ibm.dk.example.TestMDBBean.onMessage(TestMDBBean.java:58)

at

com.ibm.dk.example.TestMDBBean0Extension.onMessage(TestMDBBean0Extensio

n.java:136)

at com.ibm.mq.jms.MQSession.run(MQSession.java:1671)

at

com.sap.engine.services.ejb.message.RunnableObject.run(RunnableObject.

java:49)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionO

bject.java:37)

at java.security.AccessController.doPrivileged(Native

Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(Sing

leThread.java:94)

at com.sap.engine.core.thread.impl3.SingleThread.ru

n(SingleThread.java:162)

Caused by: com.sap.engine.lib.xml.parser.Nest

edSAXParserException: java.lang.NullPointerException(:main:, row=1, col

=198) -> java.lang.NullPointerException

at com.sap.engine.lib.xml.par

ser.DOMParser.parse(DOMParser.java:143)

at com.sap.engine.lib.xml.par

ser.DOMParser.parse(DOMParser.java:157)

at com.sap.engine.services.we

bservices.jaxm.soap.SOAPPartImpl.parseDocument(SOAPPartImpl.java:221)

at com.sap.engine.services.webservices.jaxm.soap.SOAPPartImpl.setConte

nt(SOAPPartImpl.java:189)

... 8 more

Caused by: java.lang.NullPointe

rException

at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(A

bstractXMLParser.java:155)

at com.sap.engine.lib.xml.parser.AbstractX

MLParser.parse(AbstractXMLParser.java:211)

at com.sap.engine.lib.xml.

parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:270)

at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:331)

at co

m.sap.engine.lib.xml.parser.DOMParser.parse(DOMParser.java:92)

... 11

more

BR/Brian