[jboss-user] [JBoss Web Services Users] - How do I catch a user define exception on the client (SOAP/J

newmanw10 do-not-reply at jboss.com
Fri Oct 2 10:05:05 EDT 2009


Seems like I am following the spec correctly and JAX-RPC is generating the exception class correctly (I think), but I still cannot get this to work.  I am wondering if there is something configuration wise that I need to setup in JBoss to get the correct exception back on the client side.

I have a user defined exception:
    
  | <xsd:element name="TestExceptionElement" type="xsd:string"/>
  | 
  | <message name="TestException"&gt;
  |   <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"/>
  | </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;
  |   }
  | }
  | 

When I throw this exception on the server side things look ok.  However on the client side I catch a SOAPFaultException instead of my TestException.  Has anyone successfully defined an exception and caught that exception on the client side?

Thanks,
Billy

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258420#4258420

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258420



More information about the jboss-user mailing list