HI
I am using RPCServiceClient to access an axis2 webservice.
The web-service has a method that returns a List of elements.
When I call this method from my client, I get a response back.
In debug I can see that the response is of type ArrayList and
it has 10 elements which the service just filled.
However when I iterate over the list, I see that
1. only the first element is filled and other 9 elements are null.
2. this first element is of type
org.apache.axiom.om.impl.llom.OMTextImpl and not string.
I can not figure out what is going wrong.
Can someone point me to an example of using ServiceClient to handel
return types such as Arrays and Lists?
Cheers
Tezcan
Here is my code snippet:
Class[] returnTypes = new Class[] { List.class };
Object[] response =
serviceClient.invokeBlocking(searchBankTowns,
townArgs, returnTypes);
List towns = (List)response[0];
if (towns.isEmpty())
System.out.println("EMPTY");
else{
for (Iterator iter = towns.iterator(); iter.hasNext();)
{
OMTextImpl element = (OMTextImpl) iter.next();
System.out.println("Banktown
response="+element.getText());
}
}