SOAP Fault Unmarshalling fails

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

SOAP Fault Unmarshalling fails

contact
I have a Java (WSIT) based webservice client. When we get a normal
response everythings works correctly, but when a SOAP fault is
returned, a NPE is thrown.

Before the NPE is thrown the following log entry is written:
{noformat}
Mai 19, 2016 4:50:49 PM
com.sun.xml.messaging.saaj.soap.ver1_2.Fault1_2Impl addTextNode
SEVERE: SAAJ0416: Adding text to
{http://www.w3.org/2003/05/soap-envelope}Fault is not legal
{noformat}

The string that is added as text to the soap fault consists of only
tabs, spaces and CRs ("\n      \t").

The Exception Stacktrace (from the debugger) is the following:
{noformat}
com.sun.xml.messaging.saaj.soap.ver1_2.Fault1_2Impl.addTextNode(Fault1_
2Impl.java:521)
          at
com.sun.xml.ws.api.message.saaj.SaajStaxWriter.writeCharacters(SaajStax
Writer.java:286)
          at
com.sun.xml.ws.util.xml.XMLStreamReaderToXMLStreamWriter.handleCharacte
rs(XMLStreamReaderToXMLStreamWriter.java:194)
          at
com.sun.xml.ws.util.xml.XMLStreamReaderToXMLStreamWriter.bridge(XMLStre
amReaderToXMLStreamWriter.java:135)
          at
com.sun.xml.ws.security.opt.impl.incoming.VerifiedStreamMessage.writePa
yloadTo(VerifiedStreamMessage.java:347)
          at
com.sun.xml.ws.security.opt.impl.incoming.VerifiedStreamMessage.writeEn
velope(VerifiedStreamMessage.java:378)
          at
com.sun.xml.ws.security.opt.impl.incoming.VerifiedStreamMessage.writeTo
(VerifiedStreamMessage.java:355)
          at
com.sun.xml.ws.api.message.saaj.SAAJFactory.readAsSOAPMessage(SAAJFacto
ry.java:285)
          at
com.sun.xml.ws.api.message.saaj.SAAJFactory.read(SAAJFactory.java:163)
          at
com.sun.xml.ws.message.AbstractMessageImpl.readAsSOAPMessage(AbstractMe
ssageImpl.java:249)
          at
com.sun.xml.ws.security.opt.impl.incoming.VerifiedStreamMessage.readAsS
OAPMessage(VerifiedStreamMessage.java:486)
          at
com.sun.xml.wss.jaxws.impl.PolicyResolverImpl.resolvePolicy(PolicyResol
verImpl.java:161)
          at
com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.createMessa
ge(SecurityRecipient.java:936)
          at
com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMes
sage(SecurityRecipient.java:256)
          at
com.sun.xml.wss.jaxws.impl.SecurityTubeBase.verifyInboundMessage(Securi
tyTubeBase.java:456)
          at
com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientResponsePack
et(SecurityClientTube.java:436)
          at
com.sun.xml.wss.jaxws.impl.SecurityClientTube.processResponse(SecurityC
lientTube.java:364)
          at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1147)
          at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
          at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
          at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
          at com.sun.xml.ws.client.Stub.process(Stub.java:463)
          at
com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:191)
          at
com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.ja
va:108)
          at
com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.ja
va:92)
          at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:161)
          at com.sun.proxy.$Proxy46.anfrageBonitaetsauskunft(Unknown
Source:-1)
          at
de.xxxx.SchufaServiceClient.getCreditRating(SchufaServiceClient.java:53
)
          at
de.xxxx.SchufaClientIT.getCreditRatingSoapFault(SchufaClientIT.java:29)
          at
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.j
ava:-1)
          at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja
va:62)
          at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
rImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMe
thod.java:50)
          at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCalla
ble.java:12)
          at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMeth
od.java:47)
          at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMetho
d.java:17)
          at
org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
          at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunne
r.java:78)
          at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunne
r.java:57)
          at
org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
          at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
          at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
          at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
          at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
          at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
          at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
          at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4Idea
TestRunner.java:119)
          at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4Idea
TestRunner.java:42)
          at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUn
itStarter.java:234)
          at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
{noformat}

The SOAP Message is
{noformat}
<soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
    <soapenv:Fault>
        <soapenv:Code>
            <soapenv:Value>soapenv:Receiver</soapenv:Value>
            <soapenv:Subcode>
            <soapenv:Value>soapenv:Business</soapenv:Value>
            </soapenv:Subcode>
        </soapenv:Code>
        <soapenv:Reason>
            <soapenv:Text xml:lang="de"/>
        </soapenv:Reason>
        <soapenv:Detail>
        </soapenv:Detail>
    </soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
{noformat}

Is this a bug in SAAJ or WSIT, or am I doing something wrong?

Thanks very much,
Thomas