This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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.