• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Issue with Web Service

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have developed a web service using Tomcat and Axis. I have used the return type for the method exposed in web Service as Array of Beans. Now I am not able to retrieve the array of Beans in my client code. Please help me.

Thanks,
Supraja
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can you post your client code ?

-Sai
 
Supraja Kannaiyan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ackage com;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;

import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import java.lang.reflect.*;
import mypackage.Employee;

public class EmployeeClient
{
public static void main(String [] args)
{
try {
Service service = new Service();
Call call = (Call) service.createCall();

call.setTargetEndpointAddress( new java.net.URL("http://localhost:8080/TestWebServices/services/EmployeeWebService") );
call.setOperationName( new QName("http://mypackage", "getAllEmployees") );
QName qn = new QName( "{urn:myPackage}Employee", "Employee" );
call.registerTypeMapping(Employee.class, qn,new org.apache.axis.encoding.ser.BeanSerializerFactory(Employee.class, qn),new org.apache.axis.encoding.ser.BeanDeserializerFactory(Employee.class,qn));
call.setReturnType( org.apache.axis.encoding.XMLType.XSD_ANYTYPE);

Employee ret = (Employee) call.invoke(new Object[]{} );

System.out.println("Length Of the Array : " + ret.getName());
} catch (Exception e) {
e.printStackTrace();
}
}
}
 
reply
    Bookmark Topic Watch Topic
  • New Topic