[jboss-user] [JBossWS] - [EJB3 WebService] How handle SOAPException better?
Marco.Pehla
do-not-reply at jboss.com
Thu Mar 8 10:12:36 EST 2007
Hello everybody,
I've some problems with the SOAPException handling. I wrote a EJB3 with @WebMethods and JBoss generates automatically the corresponding WSDL catalogue. In order to get a declaration of a fault message inside the WSDL, I have to throw a SOAPException in my @WebMethod.
e.g.
| @WebMethod
| public String doSomething(String input) throws SOAPException {
|
| String result = "Hello World!";
|
| if(input.equals("")) {
| throw new SOAPException("No input specified.");
| }//if
|
| return result;
| }//doSomething()
|
My client is written in PHP and able to handle SOAPExceptions like desired. If I send an empty request to my Web Service then JBoss sends a SOAPException back to the PHP client which handles this exception.
Everytime the Web Service creates a SOAPException, I get a really huge output on my JBoss console.
How could I avoid this? I mean, is it possible to handle this exceptions by myself? Or is this the normal behaviour of a SOAPException?
PS: I know, I could put this "throw new SOAPException" inside of a try-catch block, but as everybody know the client of the Web Service gets then no SOAPException message. So I need to let the exception be handled by the EJB container. Or have I to do it in the catch block?)
with kind regards,
Marco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026262#4026262
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026262
More information about the jboss-user
mailing list