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

JAX-RPC custom fault mapping not working (no detail tag in soap message)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • jbossws-native-3.1.1
    • jbossws-jaxrpc
    • None

    Description

      JBoss is not adding in the detail portion of the SOAP xml that comes back to the client. Without that tag the exception will not get translated correctly on the client side.

      I.E. The following should contain a detail tag showing how to map the thrown fault to a class on the client side.
      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <env:Header/>
      <env:Body>
      <env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <faultcode>env:Server</faultcode>
      <faultstring>Server was unable to process request.</faultstring>
      </soap:Fault>
      </soap:Body>
      </soap:Envelope>

      This affects throwing/catching a custom exception, i.e.

      user defined exception:
      <xsd:element name="TestExceptionElement" type="xsd:string"/>

      <message name="TestException">
      <part name="message" type="TestExceptionElement"/>
      </message>
      .
      .
      <operation name="throwTestException">
      <input message="tns:throwTestException_request"/>
      <output message="tns:throwTestException_response"/>
      <fault name="TestException" message="tns:TestException"t/>
      </operation>

      This generates the following code for the exception:

      public class TestException extends java.lang.Exception {
      private java.lang.String message;

      public TestException(java.lang.String message)

      { super(message); this.message = message; }

      public String getMessage()

      { return message; }

      }

      Server code:
      throw (new TestException("Throwing a test exception from the server"));

      Client code:
      try

      { // call my method that throws the exception test.testThrowException(); }

      catch (TestException e)

      { // This is the exception I should catch e.printStackTrace(); }

      catch (Exception e)

      { e.printStackTrace(); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            newmanw10 William Newman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: