Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Problem with JAX-WS when trying to parse a SOAP Fault

vladodiasOct 20 2017

Hi,

I've found a potential bug in JAX-WS when trying to parse a SOAP Fault... description below... Where do I register this so it can be assessed and fixed?

My webservice is returning a SOAP Fault like this…

pastedImage_4.png

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Body xmlns:tns="http://www.esri.com/schemas/ArcGIS/10.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  \<tns:Fault xmlns:my="urn:myNamespace" xmlns:tns="[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)">

<faultcode>tns:Client</faultcode>

<faultstring>Not found - parcel_key = 283458</faultstring>

<detail>

        \<exception>this is my exception\</exception>

     \</detail>

</tns:Fault>

</soap:Body>

</soapenv:Envelope>

When I try to call this web service, using JAX-WS, I get an unexpected NPE – Null Pointer Exception

pastedImage_5.png

Exception in thread "main" javax.xml.ws.WebServiceException: java.lang.NullPointerException

    at com.sun.xml.internal.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:196)

    at com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:203)

    at cogc.test.Class1.main(Class1.java:93)

Caused by: java.lang.NullPointerException

    at com.sun.xml.internal.ws.fault.ExceptionBean.isStackTraceXml(ExceptionBean.java:166)

    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.attachServerException(SOAPFaultBuilder.java:276)

    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:117)

    at com.sun.xml.internal.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:184)

    ... 2 more

The cause seems to be this code…

pastedImage_6.png

Possible solution would be…

public static boolean isStackTraceXml(Element n) {

return n.getLocalName().equals(LOCAL\_NAME) && n.getNamespaceURI() != null && n.getNamespaceURI().equals(NS);

}

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 17 2017
Added on Oct 20 2017
0 comments
4,719 views