Hi,
Found my own solution:D
I have to define explicitly an endpointInterface throwing my exception HelloException
Although I couldn't use SOAPFaultException (seems it has some sort of problem generating \SOAPFaultException__LiteralSerializer.java)
Neither a RuntimeException
And beside throwing my HelloException, one might note that I also set throwing RemoteException in the method in the remote interface. This will clear an warning shown in compilation time.
So my solution goes like this:
pt.sef.webservice.testingHelloBean
@Stateless(name = "Hello")
@WebService(endpointInterface="pt.sef.webservice.testing.HelloBeanRemote")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL)
public class HelloBean implements HelloLocal, HelloBeanRemote {
public HelloBean() {
}
@WebMethod(operationName = "sayHelloOp")
@WebResult(name = "resultado")
public String sayHello(@WebParam(name = "nome", mode = WebParam.Mode.IN)
String name) throws HelloException{
throw new HelloException("nao nao");
}
}
pt.sef.webservice.testing.HelloBeanRemote
@javax.ejb.Remote
@WebService(serviceName = "GreeterService")
public interface HelloBeanRemote extends java.rmi.Remote{
@WebMethod(operationName = "sayHelloOp")
@WebResult(name = "resultado")
public String sayHello(@WebParam(name = "nome", mode = WebParam.Mode.IN)
String name) throws HelloException, RemoteException;
}
pt.sef.webservice.testing.HelloException
public class HelloException extends Exception{
public HelloException() {
}
public HelloException(String msg){
super(msg);
}
}
Response found in client was exacly my exception:
client.proxy.HelloException | LocalizedMessage:nao nao | Message:nao nao | Cause:null | Stack:[Ljava.lang.StackTraceElement;@19cb082