Re: Axis2 - the client side suitability for dynamic invocation of web services
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 pradee...@gmail.com 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/
Re: Axis2 - the client side suitability for dynamic invocation of web services
Thanks Pradeep, for the info - I've just read now the doc pointer you've supplied me, and it is very helpfull, yet, it raises additional questions: 1. The client related piece of manual you have referred me to, contains several code snippets that are using Axiom classes (notably OMElement) to create a tree structure which I guess mimics SOAP message. This seems to me as novice, going into low level. Is this the only way to do it? what are the merits of using Axiom on building the soap message tree by hand? 2. 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 ? 3. Can Axis2 inter-operate successfully with WCF based web services using the ServiceClient/OperationClient APIs? If AXIS2 client cannot inter-operate out of the box with WCF based services (I assume due to the WS-* protocols besides perhaps WS-Addressing), can WSIT project come to rescue ? if so how ? (an example will be helpful here too) 4. Can someone elaborate on the advantages of using Axis2 for Web-Services consumer relative to using JAX-WS Proxy or JAX-WS Dispatch APIs) ? Thanks, Avi On Thu, Feb 26, 2009 at 1:56 PM, Pradeep Fernando pradee...@gmail.comwrote: hi Avi, I'll be much obliged if someone can tell me that whether Axis2 is suitable for one who *does not care about building web services* but only in *consuming them dynamically* may be what you are looking for is Axis2 dynamic client, where you can give the WSDL of the service as a argument during service client creation. Please refer to the article given [1] for more details. There is a sub heading called Creating Dynamic client. . Note that service client only supports WSDL1.1 at the moment. hope this helps, . [1] http://today.java.net/pub/a/today/2006/12/13/invoking-web-services-using-apache-axis2.htmlby Deepal jayasinghe.
Re: Axis2 - the client side suitability for dynamic invocation of web services
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
Re: Axis2 - the client side suitability for dynamic invocation of web services
hi Avi, I'll be much obliged if someone can tell me that whether Axis2 is suitable for one who *does not care about building web services* but only in *consuming them dynamically* may be what you are looking for is Axis2 dynamic client, where you can give the WSDL of the service as a argument during service client creation. Please refer to the article given [1] for more details. There is a sub heading called Creating Dynamic client. . Note that service client only supports WSDL1.1 at the moment. hope this helps, Pradeep. [1] http://today.java.net/pub/a/today/2006/12/13/invoking-web-services-using-apache-axis2.htmlby Deepal jayasinghe.