Hi Avi,
for your second question , you may use a RPC style client. Axis2
provide RPCServiceClient class for this , it  does not require to
build AXIOM tree your self . following example illustrate how you
could invoke  RPCServiceClient.

                        URL wsdlURL = new
URL("http://localhost:8080/axis2/services/SimpleService?wsdl";);

                        QName operationName = new QName("http://my";, 
"helloService");

                                

                        RPCServiceClient dynamicClient = new 
RPCServiceClient(null,
wsdlURL,null, null);

                        

                         //  provide the parameters as an object array and 
return types as
an class array

                        Object[] returnArray = 
dynamicClient.invokeBlocking(operationName,

                                                               new Object[] { 
"my msg" }, new Class[] { String.class });        

                

                        System.out.println(returnArray[0]);




This approach  work fine with any simple type , but the limitation is
with complex types you  have to  make available  exact Java classes
that correspond  to the complex types in client side too, I don't
think you can use  generated stub classes with this approach too.

Thanks ,

On Mon, Mar 2, 2009 at 11:35 AM, Pradeep Fernando <[email protected]> wrote:
> Hi Avi,
>
>> what are the merits of using Axiom on building the soap message tree by
>> hand?
>
> It just adds more flexibility. Sorry I don't know a specific scenario where
> it comes handy over others.
>
>> Is this the only way to do it?
>>
>> Assuming that I always have the WSDL of the target web services, Is it
>> possible that instead of creating the Axiom based tree, a
>>    runtime generated proxy (from the WSDL) can be used (and reused later
>> on) to call the Web service ?
>
> No, you can use client stub to access the service given that you have the
> wsdl. you can code generate your client stub
> using WSDL2java tool. It presents you with a nice interface(like a function
> call) without any soap message building.Refer some of these article  [1] &
> userguide.
>
>
>> Can Axis2 inter-operate successfully with WCF based web services using the
>> ServiceClient/OperationClient APIs?
>
> yes, AFAIK . correct me somebody if i am wrong.
>
>
> cheers,
> Pradeep
>
> [1] http://wso2.org/library/2873
>



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/

Reply via email to