如何使用 wsdl2java 创建 Java 代码?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6135093/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use wsdl2java created Java code?
提问by Stuti
I have a WSDL file using which I have generated server side classes in JAVA using axis2-eclipse-codegen-plugin-1.5.4and Axis 2 Service plugin. The classes are created but I don't know how to use those classes and I cann't figure out which from all those classes is the main class. It has generated many other methods which I m unable to understand.
我有一个 WSDL 文件,我使用该文件在 JAVA 中使用axis2-eclipse-codegen-plugin-1.5.4和Axis 2 Service plugin生成了服务器端类。这些类已创建,但我不知道如何使用这些类,而且我无法确定所有这些类中的哪个是主类。它产生了许多我无法理解的其他方法。
Now , I have to modify those classes for so that the service, when published, can send dummy data to client(I have to enter business logic). I am unable to do so. Can any body help/ any tutorials which can help.
现在,我必须修改这些类,以便服务在发布时可以向客户端发送虚拟数据(我必须输入业务逻辑)。我无法这样做。任何机构都可以提供帮助/任何可以提供帮助的教程。
回答by George Suaridze
You can start from this Axis2 tutorials and articles
您可以从这个Axis2 教程和文章开始
回答by drekka
If your setup will support it, starting with ejb3, writing basic beans and letting the server generate the wsdl on the fly might be easier. I've done this with glassfish3 and it worked really well.
如果您的设置支持它,从 ejb3 开始,编写基本 bean 并让服务器动态生成 wsdl 可能会更容易。我已经用 glassfish3 完成了这项工作,而且效果非常好。
回答by bamana
Check out this tutorial: Developing Web Services Using Apache Axis2 Eclipse Plugins. It is using an older version of the Axis2 Eclipse Plugin (1.3 when you are using 1.5.4), but hopefully the same steps apply, or you can figure them out based on the old tutorial.
查看本教程:使用 Apache Axis2 Eclipse 插件开发 Web 服务。它使用的是旧版本的 Axis2 Eclipse 插件(当您使用 1.5.4 时为 1.3),但希望相同的步骤适用,或者您可以根据旧教程找出它们。