2 Replies Latest reply on May 22, 2008 4:46 AM by hkorpi

    Exception binding to SOAP fault

    hkorpi

      Is it possible to bind RuntimeException e.g. IllegalArgumentException to SOAP fault detail element?

      Currently if I change my own exception to inherit from Exception class, the detail element is formed,
      but if it inherits from RuntimeException, the detail element is missing.

      Why SOAP faultcode is always env:Server even though the exception is checked exception i.e. inherits from Exception class?

        • 1. Re: Exception binding to SOAP fault
          hkorpi

          RTFM: You have to annotate your runtime exception using javax.ejb.ApplicationException annotation. Then your runtime exceptions are regarded as application exceptions. Read EJB 3.0 specification chapter 14.

          • 2. Re: Exception binding to SOAP fault
            hkorpi

            Why SOAP fault code is env:Server and HTTP status code is 500 (internal server error) in case of the application exception?

            How can I set SOAP fault code to env:Client and HTTP status code to 400 (bad request).