简体   繁体   English

如何从Java代码生成.wsdl

[英]how to generate .wsdl from java code

How to generate WSDL from a class file using eclipse Axis2 Codegen Wizard? 如何使用Eclipse Axis2 Codegen向导从类文件生成WSDL?

The steps I followed to do it: 我执行的步骤如下:

-Create a basic class, with it's interface(Simple type with no dependance) -创建一个具有接口的基本类(简单类型,无需依赖)
-right click in eclipse with axis2 codegen on the class. -在类上使用axis2代码生成右键单击eclipse。
-Fully qualified the class name my_package.class_name -完全限定类名my_package.class_name
-Adding folder(terminal folder of the package, here for example my_package) -添加文件夹(包的终端文件夹,例如my_package)

-Test: -测试:

java.lang.ClassNotFoundException: my_package.class_name not found . java.lang.ClassNotFoundException:找不到my_package.class_name (Even when I try from command line I get a classNotFound error) (即使我从命令行尝试也遇到classNotFound错误)

I have tried a thousand time with different files package. 我已经尝试了千次使用不同的文件包。 I cannot make it work... Even with explorer I am sure the .class file is well pl aced, and good folder added. 我无法使其工作...即使使用资源管理器,我也可以确定.class文件是否已正确处理,并添加了良好的文件夹。

Can you provide me an example of how generate .wsdl from .class command line or in eclipse with small file example, and all the step followed . 您能否提供一个示例,说明如何从.class命令行或Eclipse中生成带有小文件示例的 .wsdl ,以及随后的所有步骤

Thanks a lot for your time. 非常感谢您的宝贵时间。

I think the Apache CXF tool "java2wsdl" may help you. 我认为Apache CXF工具“ java2wsdl”可能会对您有所帮助。

Here's the link : https://cxf.apache.org/docs/java-to-wsdl.html 这是链接: https : //cxf.apache.org/docs/java-to-wsdl.html

Ok I found my mistakes: 好的,我发现了自己的错误:

  • First I found that the path of Axis in eclipse wasn't set. 首先,我发现Eclipse中Axis的路径未设置。
  • And by cmd I found that I tried to give .java rather than compiled .class 通过cmd,我发现我尝试提供.java而不是编译的.class

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM