2轴会自动创建(并保存)wsdl文件吗? [英] does axis 2 automatically create (and save) wsdl file?

查看:89
本文介绍了2轴会自动创建(并保存)wsdl文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我启动了一个Web服务,并使用eclipse/tomcat/axis2运行.我想将其链接到bpel进程,因此我需要wsdl文件.我可以通过启动服务器并转到

I have a web service up and running with eclipse/tomcat/axis2. I want to get it linked to a bpel process, so I need the wsdl file. I can display the wsdl by starting the server and going to

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

但是,如果我搜索项目的目录结构,则找不到wsdl文件.我当然可以从浏览器复制并粘贴wsdl并将其保存为文本文件,然后将bpel指向该wsdl.但是似乎第2轴会为我生成(并保存)一个wsdl文件,对吧?

But if I search the directory structure for the project, I can't find the wsdl file. I can of course copy and paste the wsdl from the browser and save it as a text file, then point bpel to that wsdl. But it seems like axis 2 would generate (and save) a wsdl file for me, right?

推荐答案

默认情况下,添加?wsdl时,Axis2不会检索以前生成的WSDL文档.每次都会生成. 但是,如果将WSDL文档文件和相应的XML Schema文件放在服务归档文件的META-INF文件夹中,则可以使用以下方法恢复该文件:

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

services.xml中给出的服务名称和在WSDL中定义的服务名称 文档应该相同.

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

另一方面,如果要保存生成的WSDL文档,只需使用类 org.apache.ws.java2wsdl.Java2WSDL .

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+"));
}

一旦执行了生成的WSDL文档文件和相应的XML Schema文件,您就可以在项目文件夹中找到它.

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();
}

这篇关于2轴会自动创建(并保存)wsdl文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆