I
itsprabhu
Hi all i have generated java files from wsdl using WSDL2Java. I need to
invoke a method in the web service.There is a stub file generated and
iam using them to test. Iam able to send request and even response is
coming when i see the tcptrace but its not printing anything on the
screen ,i mean the call.invoke is not at all ending .
sample program used
-----------------------------------
public class Eclient{
private static final long serialVersionUID = 1L;
String message;
public static void main(String args[]) throws Exception,SAXException {
System.out.println("in main");
try {
AesLogin aesLogin = new AesLogin();
AesBusinessSession ab = new AesBusinessSession();
Response rp = new Response();
String endpoint ="http://localhost:8008/";
System.out.println("in main");
Service service = new Service();
Call call = (Call) service.createCall(new QName("urn:Login",
"Login"));
System.out.println("in main");
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
org.apache.axis.description.ParameterDesc param;
org.apache.axis.description.OperationDesc oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("Login");
param = new org.apache.axis.description.ParameterDesc(new
javax.xml.namespace.QName("http://www.cisco.com/location/xsd",
"AesLogin"), org.apache.axis.description.ParameterDesc.IN, new
javax.xml.namespace.QName("http://www.cisco.com/location/xsd",
"AesLogin"), com.cisco.www.location.xsd.AesLogin.class, false, false);
oper.addParameter(param);
oper.setReturnType(new
javax.xml.namespace.QName("http://www.cisco.com/location/xsd",
"Response"));
oper.setReturnClass(com.cisco.www.location.xsd.Response.class);
oper.setReturnQName(new
javax.xml.namespace.QName("http://www.cisco.com/location/xsd",
"Response"));
oper.setStyle(org.apache.axis.constants.Style.RPC);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
call.setOperation(oper);
call.setUseSOAPAction(true);
call.setSOAPActionURI("urn:#Login");
call.setEncodingStyle(null);
call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR,
Boolean.FALSE);
call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
Boolean.FALSE);
call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
call.setOperationName(new QName("urn:#Login","Login"));
call.setProperty(Call.OPERATION_STYLE_PROPERTY,"rpc");
Object[] actualArgs = {aesLogin};
String ob=(String)call.invoke(actualArgs); // Not ending . I could c d
response in tcptrace.
System.out.println("ob");
} catch (Exception e) {
System.out.println("in catch "+e);
e.printStackTrace();
System.exit(0);
e.printStackTrace();
//System.err.println(e.toString());
}
}
}
can anyone tell what xactly iam missing to do.
invoke a method in the web service.There is a stub file generated and
iam using them to test. Iam able to send request and even response is
coming when i see the tcptrace but its not printing anything on the
screen ,i mean the call.invoke is not at all ending .
sample program used
-----------------------------------
public class Eclient{
private static final long serialVersionUID = 1L;
String message;
public static void main(String args[]) throws Exception,SAXException {
System.out.println("in main");
try {
AesLogin aesLogin = new AesLogin();
AesBusinessSession ab = new AesBusinessSession();
Response rp = new Response();
String endpoint ="http://localhost:8008/";
System.out.println("in main");
Service service = new Service();
Call call = (Call) service.createCall(new QName("urn:Login",
"Login"));
System.out.println("in main");
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
org.apache.axis.description.ParameterDesc param;
org.apache.axis.description.OperationDesc oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("Login");
param = new org.apache.axis.description.ParameterDesc(new
javax.xml.namespace.QName("http://www.cisco.com/location/xsd",
"AesLogin"), org.apache.axis.description.ParameterDesc.IN, new
javax.xml.namespace.QName("http://www.cisco.com/location/xsd",
"AesLogin"), com.cisco.www.location.xsd.AesLogin.class, false, false);
oper.addParameter(param);
oper.setReturnType(new
javax.xml.namespace.QName("http://www.cisco.com/location/xsd",
"Response"));
oper.setReturnClass(com.cisco.www.location.xsd.Response.class);
oper.setReturnQName(new
javax.xml.namespace.QName("http://www.cisco.com/location/xsd",
"Response"));
oper.setStyle(org.apache.axis.constants.Style.RPC);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
call.setOperation(oper);
call.setUseSOAPAction(true);
call.setSOAPActionURI("urn:#Login");
call.setEncodingStyle(null);
call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR,
Boolean.FALSE);
call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
Boolean.FALSE);
call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
call.setOperationName(new QName("urn:#Login","Login"));
call.setProperty(Call.OPERATION_STYLE_PROPERTY,"rpc");
Object[] actualArgs = {aesLogin};
String ob=(String)call.invoke(actualArgs); // Not ending . I could c d
response in tcptrace.
System.out.println("ob");
} catch (Exception e) {
System.out.println("in catch "+e);
e.printStackTrace();
System.exit(0);
e.printStackTrace();
//System.err.println(e.toString());
}
}
}
can anyone tell what xactly iam missing to do.