Wednesday, May 7, 2014

Consuming a Web Service

What you need:
- wsdl source

1. Use wsimport tool from java se. In command line enter:
wsimport -keep -s , e.g. wsimport -keep -s src
-keep - keep generated files (.java files)

2. Import the the java files in your project and use them as stubs to call the webservice method(s). The name of the stub you can use can be found in the wsdl:service tag of the wsdl.
Ex.
 name="CurrencyConvertor">

CurrencyConvertor cc = new CurrencyConvertor();
CurrencyConvertorSoap ccs = cc.getCurrencyConvertorSoap();




No comments:

Post a Comment