axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asit Jaiswal (JIRA)" <>
Subject [jira] Created: (AXIS2-4971) How to get array of object using RPCServiceClient
Date Thu, 03 Mar 2011 11:33:37 GMT
How to get array of object using RPCServiceClient

                 Key: AXIS2-4971
             Project: Axis2
          Issue Type: Bug
            Reporter: Asit Jaiswal

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");
              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");
             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.
For more information on JIRA, see:


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

View raw message