One of my system need to invoke SOAP based webservices. As of now, for every new webservices, I generate Java stubs from the provided WSDL file and redeploy the web application with new webservice consumer code. Is there a good approach to dynamically create a webservice client that can invoke the methods from the provided WSDL files? All I am expecting is
- put the WSDL file in the location that can be accessed by the web application
- invoke the Servlet with a keyword having the wsdl file name, and other params required for the webservice method.
Can the Apache CXF help in this? I read in a post, generating wsdl2java in the runtime and loading the classes, over a time, can exhaust the pemgen memory space.
Best Answer
You should look here : http://cxf.apache.org/docs/dynamic-clients.html This is exactly that.
here an example:
There is many other examples in the source distribution of cxf.