In this topic, I will discuss how to use maven to generate web service client code automatically with Apache CXF, here are the step by step instructions:
- Before you prepare the maven pom file, you first should get the WSDL file
For instance, if you are using Siebel, you can download it from Administration – Web Services, you can find a lot of vanila Siebel inbound web services there.
- Create a POM file, here is an example by using cxf code generate plugin, please download the pom file:
- Run mvn genereate-resources
You will find the source code will be gerenated to the targe folder, see the screen shot below:
- Run mvn install to package it as a jar file
- Done