does axis 2 automatically create (and save) wsdl file?

谁都会走 提交于 2019-12-04 03:33:17

By default, when you add ?wsdl, Axis2 does not retrieve a previously generated WSDL document. It is generated every time. But if you put the WSDL document file and the corresponding XML Schema files inside the META-INF folder in the service archive file, it can be recovered with:

http://localhost:8080/axis2/services/MyService.wsdl

The service name given in the services.xml and the service name defined in the WSDL document should be the same.

In another hand, if you want to save a generated WSDL document, simply run something like the following snippet as a Java Application on some class of your project, using the class org.apache.ws.java2wsdl.Java2WSDL.

public static void main(String[] args) throws Exception {
    Java2WSDL.main("-cn com.abc.MyService".split("\\s+"));
}

Once it has been executed, the generated WSDL document file and the corresponding XML Schema files you can find it in the folder of the project.

To find out more options to use them with this tool, use the following:

public static void main(String[] args) throws Exception {
    Java2WSDL.printUsage();
}

It doesn't keep a wsdl in the file system. You need to save it as .wsdl file and point your BPEL to it. Or else you can follow java2wsdl wizard as mentioned in http://axis.apache.org/axis2/java/core/tools/eclipse/wsdl2java-plugin.html to generate the wsdl from the code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!