// Constructing the arguments array for the method invocation
Object[] opAddEntryArgs = new Object[] { entry };
// Invoking the method
RPCServiceClient serviceClient = getRPCClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference(
"local://services/AddressBookService");
options.setTo(targetEPR);
options.setAction("addEntry");
Object[] ret = serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs, new Class[]{Integer.class});
assertEquals(ret[0], new Integer(1));
QName opFindEntry = new QName("http://rpc.axis2.apache.org", "findEntry");
String name = "Abby Cadabby";
Object[] opFindEntryArgs = new Object[] { name };
Class[] returnTypes = new Class[] { Entry.class };
RPCServiceClient serviceClient2 = getRPCClient();
Options options2 = serviceClient2.getOptions();
EndpointReference targetEPR2 = new EndpointReference(
"local://services/AddressBookService");
options2.setTo(targetEPR2);
options2.setAction("findEntry");
Object[] response = serviceClient2.invokeBlocking(opFindEntry,
opFindEntryArgs, returnTypes);
Entry result = (Entry) response[0];
assertNotNull(result);