1. Download the CXF tool and extract it to disk
2. Add the tool bin directory to the PATH environment variable 3. Create a new CXF client project
4. Run-cmd to the specified directory and run the batch "Wadl2java.bat" under the Tools directory
5. When you are finished, refresh the project in the IDE and you will find the newly generated package + file
6. Write the client class to access the Webserivce
Package Com.example.tuo.mycxfwebservice.ws_client;import Com.example.tuo.webservice.helloworld;import Com.example.tuo.webservice.helloworldservice;public class Client {public static void main (string[] args) {//TODO Auto-generated method Stubhelloworld helloworldclient = new HelloWorldService (). Gethelloworldport (); String result = Helloworldclient.sayhello ("Tony"); SYSTEM.OUT.PRINTLN (result);}}
Run the program and see the output of the SayHello that called WebService in the console: Hello world,tony
WebService-Java Implementation CXF (using the CXF tool to generate the client program)