We are in the process of moving an application from Oracle Weblogic Portal 10.3.6 over to Jetty. In the process jaxws-rt has been upgraded to version 2.2.8. Previously we were using the version embedded with Weblogic which I believe is based on version 2.1.6 or 2.1.7.
The issue we're running into now is NullPointerExceptions when JAX-WS tries to parse some of the SOAP Faults coming from the service bus that we are consuming. The reason the parsing fails is that SOAP Fault contains the entire original response message wrapped inside the fault detail element, leaving the SOAP message with two envelope tags. When the parser reaches the end of the first soap:envelope and tries to get the parent node it just returns null. It returns null because there is a check for 'parentNode instanceof SOAPDocument', and that returns true even though the parentNode is the request element.
According to the definition at http://schemas.xmlsoap.org/soap/envelope/ the detail element can contain anything.
Even though it says the detail element can contain anything, is having an envelope wrapped inside an other envelope valid SOAP, or is the jaxws-rt implementation wrong?
This is an example of a SOAP fault that fails to parse:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>BEA-380001: Internal Server Error</faultstring>
<faultactor>dummy-code</faultactor>
<detail>
<mock>
<request>
<soap:Envelope>
<S:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
</S:Header>
<S:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
</S:Body>
</soap:Envelope>
</request>
<response>
<ns4:responseState xmlns:ns2="urn:srv.sag.enterprise.fs.edb.com:domain:element:v13_1" xmlns:ns4="urn:enterprise.fs.edb.com:domain:common:v1" xmlns:ns3="urn:srv.sag.enterprise.fs.edb.com:ws:element:v13_1" xmlns:ns9="urn:srv.agr.enterprise.fs.edb.com:domain:engagement:v14:2" xmlns:ns5="urn:srv.agr.enterprise.fs.edb.com:domain:engagement:v14:3" xmlns:ns6="urn:srv.agr.enterprise.fs.edb.com:domain:alertcodes:v1" xmlns:ns7="urn:srv.agr.enterprise.fs.edb.com:ws:engagement:v14_3" xmlns:ns8="urn:corews.enterprise.fs.edb.com:domain:common:v1">
<wsc:ErrorCode xmlns:wsc="http://mock.url/">68</wsc:ErrorCode>
<wsc:Severity xmlns:wsc="http://mock.url">2</wsc:Severity>
<wsc:ComponentId xmlns:wsc="http://mock.url">852</wsc:ComponentId>
<wsc:StrErrorCode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsc="http://mock.url"/>
<wsc:Message xmlns:wsc="http://mock.url">Test message</wsc:Message>
<wsc:NativeError xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsc="http://mock.url"/>
<wsc:LogSequence xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsc="http://mock.url"/>
<wsc:errorItem key="LogRef" value="1425988364991" xmlns:wsc="http://mock.url"/>
</ns4:responseState>
</response>
</mock>
</detail>
</soap:Fault>
</soap:Body>
</soapenv:Envelope>
Thanks for your help!