[
https://issues.apache.org/jira/browse/AXIS2-4971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126426#comment-13126426
]
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.
Thanks
Shameera
> How to get array of object using RPCServiceClient
> -------------------------------------------------
>
> Key: AXIS2-4971
> URL: https://issues.apache.org/jira/browse/AXIS2-4971
> 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("http://search.status.com",
> "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:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]