[JBossWS] - [EJB3 WebService] How handle SOAPException better?
by Marco.Pehla
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
17 years, 9 months
[JBossWS] - Re: Exception client / User guide Echo sample
by valjjou
Thanks Peter for your help.
I use JBoss 4.0.5 GA and WS 1.2.
I try with saaj.jar but i always have an exception, a soap exception:
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
at $Proxy15.echo(Unknown Source)
at echo.EchoClient.main(EchoClient.java:9)
Caused by: javax.xml.soap.SOAPException: Could not transmit message
at org.jboss.ws.core.soap.SOAPConnectionImpl.callInternal(SOAPConnection Impl.java:221)
at org.jboss.ws.core.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:109)
at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:309)
at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:185)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:163)
at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:149)
... 2 more
This is only a part of the exception... I use wsrunclient...
Thanks for help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026188#4026188
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026188
17 years, 9 months