You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Te...@HVBIS.com on 2008/03/25 17:39:23 UTC

how to use ServiceClient

Hi
I am a newbee to axis2 and am having trouble getting data from my
web-service.
I have sucessfully created a service and can call it using the
RPCServiceClient.

I have than extended my service to have a method that returns an array
of objects.
I can call this method on the web-service but when it returns I am not
receiving anything.

Now I do not know what I need to do in my RPCServiceClient to handle
this new method call/response situation.

Can ServiceClient cope with complex types such as Arrays, Lists,
Vectors?
Can some one point me to an example of how to do this?

Best Regards
Tezcan Dilshener


AW: how to use ServiceClient

Posted by Te...@HVBIS.com.
Hi 
thnx for the reply.
Yes at the client side I am having difficulties evaluating the response.
The TCPMon showed that the response from webservice is correctly filled.

It looks like when I call the methods of the web-service that returns 
an array of objects or List of elements 
than the RPCServiceClient is not correctly unpacking it.



I must be doing something wrong at the client side.
Can you help? 
Can you point me to some links regarding RPCServiceClient usage with Arrays/Lists?

Cheers
Tezcan

Here is the code snippet: 
The server fills 10 items and TCPMon shows them all
but the iteration only prints one.
        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()); 
                        } 
        } 

-----Ursprüngliche Nachricht-----
Von: Deepal Jayasinghe [mailto:deepal@opensource.lk] 
Gesendet: Mittwoch, 26. März 2008 06:32
An: axis-user@ws.apache.org
Betreff: Re: how to use ServiceClient



> Hi
> I am a newbee to axis2 and am having trouble getting data from my
> web-service.
> I have sucessfully created a service and can call it using the 
> RPCServiceClient.
>
> I have than extended my service to have a method that returns an array
> of objects.
> I can call this method on the web-service but when it returns I am not 
> receiving anything.
>
You mean at the client side ?
can you see the request and response in the TCP monitor ?
>
> Now I do not know what I need to do in my RPCServiceClient to handle
> this new method call/response situation.
>
You can use RPCServiceClient to handle this case.
>
> Can ServiceClient cope with complex types such as Arrays, Lists, 
> Vectors?
>
Well Axis2 does not support Vectors but other two.

-Deepal


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: how to use ServiceClient

Posted by Deepal Jayasinghe <de...@opensource.lk>.
> Hi
> I am a newbee to axis2 and am having trouble getting data from my 
> web-service.
> I have sucessfully created a service and can call it using the 
> RPCServiceClient.
>
> I have than extended my service to have a method that returns an array 
> of objects.
> I can call this method on the web-service but when it returns I am not 
> receiving anything.
>
You mean at the client side ?
can you see the request and response in the TCP monitor ?
>
> Now I do not know what I need to do in my RPCServiceClient to handle 
> this new method call/response situation.
>
You can use RPCServiceClient to handle this case.
>
> Can ServiceClient cope with complex types such as Arrays, Lists, Vectors?
>
Well Axis2 does not support Vectors but other two.

-Deepal


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org