<detail> is missing in SOAP Fault when a web service throws an exception in EAP 6

Solution Unverified - Updated -

Issue

  • We are migrating a web service application from GlassFish to JBoss.
  • When we throw an exception JBoss does not include <detail> in the response.
  • This is how we are sending the SOAP Fault now:
final String reason = "Data not found";
SOAPFactory factory = SOAPFactory.newInstance();
javax.xml.soap.SOAPFault fault = factory.createFault(reason, new QName("CLIENT"));
throw new DataNotFoundFault_Exception(
    reason, new DataNotFoundFault(), new SOAPFaultException(fault));
  • Response in GlassFish:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
         <faultcode>CLIENT</faultcode>
         <faultstring>Data not found</faultstring>
         <detail>
            <ns2:dataNotFoundFault xmlns:ns2="http://www.example.com/soap/app"/>
         </detail>
      </S:Fault>
   </S:Body>
</S:Envelope>
  • Response in JBoss:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:CLIENT</faultcode>
         <faultstring>Data not found</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>
  • The node <detail> and its contents are missing when we run the application from JBoss.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content