Hi,
I am consuming a web service in a client. I have two methods one that
returns back an xml string and another one that returns the object. When I
call the method that returns xml back it works fine as expected. In case of
calling method that returns object, it returns blank object. Is there
anything I am doing wrong in the client code? Could anyone please advise if
I am missing something obvious? Below is my client code :
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new
java.net.URL("http://localhost:8080/axis2/services/CustomerInformationWS?wsdl
"));
String custId = "999";
String maSrNo = "555";
call.setOperationName(new QName("
http://businessobject.o2c.adt.com/xsd", "getCustomerTO"));
call.addParameter ("custId", org.apache.axis.encoding
.XMLType.XSD_INT,
javax.xml.rpc.ParameterMode.IN<http://javax.xml.rpc.parametermode.in/>
);
call.addParameter("maSrNo", org.apache.axis.encoding.XMLType.XSD_INT
, javax.xml.rpc.ParameterMode.IN <http://javax.xml.rpc.parametermode.in/>);
QName qnm = new QName("
http://transferobject.o2c.adt.com/xsd)<http://transferobject.o2c.adt.com/xsd%29>",
"getCustomerTO");
call.registerTypeMapping (CustInfoTO.class, qnm, new
org.apache.axis.encoding.ser.BeanSerializerFactory (CustInfoTO.class, qnm),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(CustInfoTO.class,
qnm));
call.setReturnType(new QName("http://transferobject.o2c.adt.com/xsd)
<http://transferobject.o2c.adt.com/xsd%29>", "getCustomerTO"));
CustInfoTO result = (CustInfoTO) call.invoke(new Object[] { custId,
maSrNo });
System.out.println("Result is " + result.getCCVL_CU_NO());
//////////all the attributes in the object are set to null or 0 and not what
I expect in the object.
I will appreciate any help/suggestion on this.
Thanks,
Shyam