OMElement value = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org", "testCompanyArray", "req"), req.toArray());
assertEquals("4", value.getFirstElement().getText());
}
public void testCompanyArray() throws AxisFault {
RPCServiceClient sender = getRPCClient("EchoXMLService", "CompanyArray");
Company com = new Company();
com.setName("MyCompany");
ArrayList ps = new ArrayList();
Person p1 = new Person();
p1.setAge(10);
p1.setName("P1");
ps.add(p1);
Person p2 = new Person();
p2.setAge(15);
p2.setName("P2");
ps.add(p2);
Person p3 = new Person();
p3.setAge(20);
p3.setName("P3");
ps.add(p3);
com.setPersons(ps);
ArrayList args = new ArrayList();
args.add(com);
args.add(com);
args.add(com);
args.add(com);
ArrayList req = new ArrayList();
req.add(args.toArray());
ArrayList resobj = new ArrayList();
resobj.add(Company.class);
resobj.add(Company.class);
resobj.add(Company.class);
resobj.add(Company.class);
Object [] value = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org", "CompanyArray", "req"), req.toArray(),
(Class[])resobj.toArray(new Class[resobj.size()]));
assertEquals(4, value.length);
assertEquals(((Company)value[0]).getName(), "MyCompany");
}