This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
I am newbie to the world of webservices and have been learning through various tutorials online.
I understand that provided a WSDL, you can generate client stub using AXIS2 - say XML beans method. (It generates lots and lots of classes and I don't like that so many of them integrated into my application code)
My Question: Can we have a generic java client which could invoke any webservice ? Say we provide service details(like endpoint URL), Header elements, Body elements - as arguments to a method in the generic java client. All the client does is build soap message using the input parameters and invoke the webservice and pass back the response.
I am working on an application which is supposed to invoke several synchronous soap based webservices. I am trying to understand if I can build a common re-usable client for all the webservices instead of generating hundreds of java files for each of them using AXIS2- XMLBeans method.
Well, I suppose it is possible, but what would be the advantage?
You would end up having to find some way to tell this generic client what to do with the received SOAP response. Given the huge variety of possible SOAP services that would get quite as complicated as writing custom code in Java.
Of course, if you are accessing RESTful services it would be somewhat simpler.
Joined: Jun 26, 2011
William Brogden wrote:Well, I suppose it is possible, but what would be the advantage?
Could you point me to some sample code as to how I can write a generic client.
You would end up having to find some way to tell this generic client what to do with the received SOAP response. Given the huge variety of possible SOAP services that would get quite as complicated as writing custom code in Java. [/quote wrote:
This generic client code will simply pass back the soap response to the calling method. It will not process Soap response messages.
subject: Generic Client To Invoke Different Webservices