throwing Exception from server side arrives empty in client side
----------------------------------------------------------------
Key: XFIRE-1106
URL: http://jira.codehaus.org/browse/XFIRE-1106
Project: XFire
Issue Type: Bug
Components: WS-Security
Affects Versions: 1.2.6
Environment: Windows (eclipse)
Reporter: oegozi
Assignee: Dan Diephouse
Hi ,
I just started working with xfire with webservices, and I read somewhere that I
can throw my own exception on server side and catch it on client side.
When I tried it, the exception was indeed caught on client side, but with no
content (null content).
All the steps are written below, Does anyone know what is the problem?
Thanks
Ora
1. server side - the addNotification method:
Service declaration -
@WebMethod(operationName = "addNotification")
@WebResult(name = "addNotificationRes")
public void addNotification(@WebParam(name = "ws_header", header = true, mode =
WebParam.Mode.INOUT)Holder<WebServiceHeader> ws_header
,@WebParam(name = "source") String source
,@WebParam(name = "subject") String subject
,@WebParam(name = "message") String message
) throws WeatherException;
//Inside the service we throw the exception -
throw new WeatherException(new Throwable("my cause"), "my msg", new
WeatherFaultDetail());
/*Note: the WeatherFaultDetail has a default Ctor which assigns values to the
inner members, and therefore I expect them to arrive to client side.*/
2. catch the exception successfully in the client side but THE CONTENT OF THE
exception doesnt arrive (null):
try {
service.addNotification(ws_header, "src", "sub", "msg");
} catch (WeatherException e) {
details = e.getFaultDetail();
}
//DETAILS ARRIVES NULL
3. Here is the exception classes (it has all required setters and getters as
far as I can see)
import javax.xml.namespace.QName;
import org.codehaus.xfire.fault.FaultInfoException;
public class WeatherException extends FaultInfoException {
private WeatherFaultDetail faultDetail;
public WeatherException() {
super();
}
public WeatherException(Throwable cause, String message,
WeatherFaultDetail detail) {
super(message, cause);
this.faultDetail = detail;
}
public WeatherFaultDetail getFaultInfo() {
return faultDetail;
}
public void setFaultInfo(WeatherFaultDetail faultDetail) {
this.faultDetail = faultDetail;
}
public static QName getFaultName() {
return new QName("http://www.xxxx.com", "WeatherFault");
}
public WeatherFaultDetail getFaultDetail() {
return faultDetail;
}
public void setFaultDetail(WeatherFaultDetail faultDetail) {
this.faultDetail = faultDetail;
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email