axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shameera Rathnayaka (Commented) (JIRA)" <>
Subject [jira] [Commented] (AXIS2-4971) How to get array of object using RPCServiceClient
Date Thu, 13 Oct 2011 08:23:11 GMT


Shameera Rathnayaka commented on AXIS2-4971:

Hi Asit,

AFAIK this isn't a bug This is one of limitation of RPCServiceClient, And also this improvement
require significant changes to the deserialize method in BeanUtill class. Which is a big deal
we should not change it unless we have significant reason to change it, As RPCServiceClient
has several limitations this isn't a considerable reason to change it as i think.

> How to get array of object using RPCServiceClient
> -------------------------------------------------
>                 Key: AXIS2-4971
>                 URL:
>             Project: Axis2
>          Issue Type: Bug
>            Reporter: Asit Jaiswal
> Hi,
> I tried the following code to get array of object, but all the time I get only one object.
>  RPCServiceClient serviceClient = new RPCServiceClient();
>               Options options = serviceClient.getOptions();
>               EndpointReference targetEPR = new EndpointReference("http://localhost:8080/Module/services/SearchService");
>               options.setTo(targetEPR);
>               QName qname1 = new QName("", "getResult");
>               Object[] args1 = new Object[] {"page" };
>               Class[] types1 = new Class[] { Result.class};
>               Object[] response1 = serviceClient.invokeBlocking(qname1, args1, types1);
>              System.out.println("Lenght of response is "+response1.length);
>               Result u1 = (Result) response1[0];
>               if (u1 == null) {
>                   System.out.println("u1 was null");
>                   return;
>               }
>              for(int i=0;i<response1.length;i++){ u1 = (Result)response1[i]; System.out.println(u1.getTitle());
System.out.println(u1.getName()); System.out.println(u1.getMetatag()); } The above code is
ok if we have to get only one object at client side, but if I want to get two or more objects
in response, I have to modify above line (the line which is in bold fonts) by <b>  Class[]
types1 = new Class[] { Result.class,Result.class,Result.class,Result.class};
> In which I have to repeat Result.class number of time at the number of object I want,
but How I come to know that how many objects will be there in response,
> Please suggest me some Idea.
> Thanks in advance
> Asit Jaiswal 

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message