[JBossWS] - Re: How to create Cutom SoapException
by kapil.singhal
I want to fill in SOAPFault with meaningful details.
The SOAPFault contains the following:
- FaultCode
- FaultActor
- FaultString
- Detail
I can fill-in most of the elements except the Detail object. This Detail object has the ability to contain a XML node, where I want to pass some of the details specific to the exception.
Please refer to class "org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper", which constructs a "javax.xml.rpc.soap.SOAPFaultException" from our exception that we are throwing from the service.
If you look at the implementation of SOAPFaultExceptionHelper, you find that the Actor and Detail object are passed as null. As a result of this my client cannot get additional details, which I want to convey.
Please suggest me a way that I can fill meaningful values in the SOAPFault which I want to throw from the server side. As in this case the same exception will be conveyed as it is.
Regards,
Kapil
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977873#3977873
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977873
19 years, 7 months
[JBossWS] - ejb3, jbossws and exceptions
by 600114046
Hi,
I have an ejb which is exposed over a webservice. The methods on the ejb that have no chance of throwing exceptions work fine. As soon as I put in a new method which can throw an application exception (and generate is as a web method) none of my methods work over web services... i get this error:
Exception in thread "main" java.rmi.RemoteException: Call invocation failed with code [Client] because of: javax.xml.rpc.JAXRPCException: Cannot create or send response message; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: javax.xml.rpc.JAXRPCException: Cannot create or send response message
at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:715)
at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:398)
....(then the class where the method gets invoked)
I've tried various techniques -even wrapping the exception in a remoteException just to see if i could get it working. Any ideas what i might be doing wrong?
Thanks.
CODE:
-----------------
My Bean:
//Annotations left out
public class MMAPIBean implements MMAPI
{
public GetEchoResult getEcho(String echo){
GetEchoResult ge = new GetEchoResult();
ge.setEchoInString(echo);
return ge;
}
public ReferenceTypeResult getStatusCodes() throws RemoteException {
try {
ReferenceTypes rt = new ReferenceTypes();
return rt.getStatusCodes();
} catch (MMAPIException e) {
throw new RemoteException(e.getMessage());
}
}
}
------------
Remote and local interface:
@Local
@Remote
public interface MMAPI
{
public GetEchoResult getEcho(String echo);
public ReferenceTypeResult getStatusCodes() throws RemoteException;
}
----------------
Service endpoint:
// Annotations left out
public interface MMAPIsei extends Remote {
@WebMethod
public GetEchoResult getEcho(String echo) throws RemoteException;
@WebMethod
public ReferenceTypeResult getStatusCodes() throws RemoteException;
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977870#3977870
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977870
19 years, 7 months