Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-739

JBossWS ignores the fault actor and detail elements of a SOAPFaultException

XMLWordPrintable

      JBossWS seems to have a problem on the translation between SOAPFaultException
      and SOAPFault, that is performed by SOAPFaultExceptionHelper
      (getSOAPFaultException and exceptionToFaultMessage methods). For example, if I
      run this test method (based on
      org.jboss.test.ws.soap.SOAPFaultTestCase.testExceptionToFault()):

      [code]
      public void testExceptionToFault() throws Exception
      {
      SOAPFactory factory = SOAPFactory.newInstance();

      // Create a detail element.
      Detail detail = factory.createDetail();
      Name el1 = factory.createName("name", "ns1", "http://somens");
      DetailEntry detailEntry = detail.addDetailEntry(el1);
      detailEntry.setValue("Kermmit");

      SOAPFaultException faultEx = new SOAPFaultException(Constants.SOAP11_FAULT_CODE_CLIENT, "Some fault message", "Some fault actor", detail);
      SOAPEnvelope soapEnv = SOAPFaultExceptionHelper.exceptionToFaultMessage(faultEx).getSOAPPart().getEnvelope();

      assertEquals(DOMUtils.parse(envStr), soapEnv);
      }
      [/code]

      The soapEnv variable will contain the following:

      [code]
      <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
      <env:Header/>
      <env:Body>
      <env:Fault>
      <faultcode>env:Client</faultcode>
      <faultstring>Some fault message</faultstring>
      </env:Fault>
      </env:Body>
      </env:Envelope>
      [/code]

      When in fact it should contain:

      [code]
      <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
      <env:Header/>
      <env:Body>
      <env:Fault>
      <faultcode>env:Client</faultcode>
      <faultstring>Some fault message</faultstring>
      <faultactor>Some fault actor</faultactor>
      <detail>
      <ns1:name xmlns:ns1='http://somens'>Kermmit</ns1:name>
      </detail>
      </env:Fault>
      </env:Body>
      </env:Envelope>
      [/code]

      What I mean is that JBossWS ignores the fault actor and detail elements of a
      SOAPFaultException. I've attached a modified SOAPFaultTestCase that reproduces
      this error.

            tdiesler@redhat.com Thomas Diesler
            ivanneto_jira Ivan Neto (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: