开发者

How to add a method to an existing web service develoment with axis2 and eclipse

i've a web service written with axis2, starting from wsdl using wsdl2java utility. I developed it using eclipse. It works fine. What's the best way to add a new method to the web service? I must add the method in the wsdl and recreate all the java file with wsdl2java and copy 开发者_高级运维the actual code in the new class? Or there's a quicker way?

Thank you in advace.

Nicola


If you are using the "contract first" approach, the best way to add a method is indeed to modify the WSDL and then regenerate your classes with wsdl2java.

The tools will recreate all your skeleton classes so make sure that this does not override any code you added to it or you will loose your modifications. To avoid this you should generate an interface for the skeleton with the -ssi parameter. Then, have your own class implement this interface and use it instead of the implementation that the wsdl2java creates.


You can even add new method in code and make entry of method in WSDL and conf\axis

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜