Re: Consuming Web Service that returns object - blank object problem

2007-01-18 Thread Anne Thomas Manes

Please post the WSDL for the service.

On 1/15/07, Shyamal Shah <[EMAIL PROTECTED]> wrote:

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);
call.addParameter("maSrNo",
org.apache.axis.encoding.XMLType.XSD_INT,
javax.xml.rpc.ParameterMode.IN);
QName qnm = new QName("
http://transferobject.o2c.adt.com/xsd)", "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) ",
"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


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Consuming Web Service that returns object - blank object problem

2007-01-15 Thread Shyamal Shah

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
);
   call.addParameter("maSrNo", org.apache.axis.encoding.XMLType.XSD_INT
, javax.xml.rpc.ParameterMode.IN );
   QName qnm = new QName("
http://transferobject.o2c.adt.com/xsd)",
"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)
", "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