Java – generate client stub from WSDL
I'm starting a new project with a commercial supplier I need to write an integration module in our application to use the commercial vendor's Web services Therefore, WSDL is out of our control
I think the general approach is to do "contract first" development and generate stubs from WSDL files I wonder what technologies can do this? I really like the simplest way We widely use Maven 3.0 3 and spring 3.0 5. Can I use spring webservicetemplate?
If the problem is unclear or additional details are required, please contact us
Thank you, tapasvi
Solution
You can use Maven plugin for Jax - ws to generate Java stubs You can then expose them as web services using stubs in spring Fortunately, this is simple:)
Just a suggestion, don't regenerate the stub every time you build a project, because (obviously) you won't be able to add any code to the stub, which is sometimes very useful I made this mistake a long time ago, which was painful because I had to put the code where it didn't belong Over the past few years, I have used Maven configuration files to generate stubs on demand, and then I "manually" merge them to add additional code Of course, this is only possible if the WSDL changes infrequently