try {
Service2Interface proxy =
(Service2Interface) RMIClientProxy.createProxy(Service2Interface.class,
this.configurator,
"http://localhost:8080/axis2/services/Service2");
ChildClass childClass = new ChildClass();
childClass.setParam1("test param1");
childClass.setParam2(10);
childClass.setParam3("test param3");
childClass.setParam4(new Integer(12));
ChildClass result = (ChildClass) proxy.method1(childClass);
System.out.println("Result param 1 ==> " + result.getParam1());
System.out.println("Result param 2 ==> " + result.getParam2());
System.out.println("Result param 3 ==> " + result.getParam3());
System.out.println("Result param 4 ==> " + result.getParam4());
} catch (Exception e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}