You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2002/07/09 16:02:53 UTC
DO NOT REPLY [Bug 10590] New: -
Cannot return AxisFault to client stub.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10590>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10590
Cannot return AxisFault to client stub.
Summary: Cannot return AxisFault to client stub.
Product: Axis
Version: current (nightly)
Platform: PC
OS/Version: Windows NT/2K
Status: NEW
Severity: Major
Priority: Other
Component: Basic Architecture
AssignedTo: axis-dev@xml.apache.org
ReportedBy: geza.szocs@nokia.com
Platform: NT4 (can be reproduced on Sun Solaris too)
Axis: nightly build 07.02
Webserver: Tomcat 4.0.3.
I have generated client stub from WSDL, which has the following fragment:
-----------------------------------------------------------------------
public double calc(java.lang.String string_1, double double_2,
double double_3) throws java.rmi.RemoteException{
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call call = createCall();
javax.xml.namespace.QName p0QName = new
javax.xml.namespace.QName("", "String_1");
call.addParameter(p0QName, new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"),
java.lang.String.class, javax.xml.rpc.ParameterMode.IN);
javax.xml.namespace.QName p1QName = new
javax.xml.namespace.QName("", "double_2");
call.addParameter(p1QName, new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "double"),
double.class, javax.xml.rpc.ParameterMode.IN);
javax.xml.namespace.QName p2QName = new
javax.xml.namespace.QName("", "double_3");
call.addParameter(p2QName, new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "double"),
double.class, javax.xml.rpc.ParameterMode.IN);
call.setReturnType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"double"));
call.setUseSOAPAction(true);
call.setSOAPActionURI("");
call.setOperationStyle("rpc");
call.setOperationName(new
javax.xml.namespace.QName("http://hello.org/wsdl", "calc"));
Object resp = call.invoke(new Object[] {string_1, new
Double(double_2), new Double(double_3)});
if (resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)resp;
}
else {
try {
return ((Double) resp).doubleValue();
} catch (java.lang.Exception e) {
return ((Double)
org.apache.axis.utils.JavaUtils.convert(resp,
double.class)).doubleValue();
}
}
}
-----------------------------------------------------------------------
So far so good, but when this "calc" method is called and the server
side throws an AxisFault, the "resp" object is null instead of AxisFault
object. Since null is not an instance of RemoteException, it causes a
NullPointerException in line:
return ((Double)org.apache.axis.utils.JavaUtils.convert
(resp,double.class)).doubleValue();
Exception stacktrace and axis.log are too long to insert in this report,
but I can send them if needed.
Br, Szocs Geza