通过检查 WSDL 文件确定 Web 服务中可用的方法
(我对 Web 服务相当陌生,请原谅任何不正确的术语)
给定一个 WSDL URL,如何通过查看 WSDL 文件的源来确定该 Web 服务中可用的方法?
另外,如何构造 SOAP 响应以与 WSDL 文件一起使用以将数据发送回 Web 服务?
(I am fairly new to web services, kindly excuse any incorrect terminology)
Given a WSDL URL, how does one determine what methods are available in that web service by looking at the source of the WSDL file?
Also, how does one construct a SOAP response to use with the WSDL file to post data back to the web service?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为你问的是如何解释 wsdl。以下文章[1][2]可能会对您有所帮助。
[1] http://wso2.org/library/2873
[2] http://wso2.org/library/2935
I think what you ask is how to interpret a wsdl. Following articles[1][2] may help you.
[1] http://wso2.org/library/2873
[2] http://wso2.org/library/2935
与其他文件不同,我不会详细介绍 WSDL 文件以及如何阅读它。您最终将通过阅读书籍、文章、尝试网络服务等方式自学所有这些。
我要做的是向您推荐一个非常简单易用但功能强大的工具,而不是每个网络的工具箱中必须有的工具服务开发人员(尤其是刚接触 Web 服务的人):SoapUI。
您在 SoapUI 中创建一个简单的项目并将其指向 Web 服务的 WSDL 文件。它将发现操作、创建示例请求和响应消息、创建 Web 服务的模拟等等。
然后,您可以查看 WSDL 代码,并借助 SoapUI 中提供的内容来发现每个方法中涉及哪些元素。
Unlike the others, I'm not going to go into details about the WSDL file and how you can read it. You will eventually learn all of that by yourself by reading books, articles, experimenting with web services etc.
What I'm going to do is recommend you a very simple to use, yet powerful tool, than must be in the toolbox of every web service developer (especially someone new to web services): SoapUI.
You create a simple project in SoapUI and point it to the WSDL file of the web service. It will discover the operations, create sample request and response messages, create mocks of the web service and much more.
You can then look at the WSDL code and with the help of what's presented inside SoapUI discover which elements are involved in each method.
只需在您的 WSDL 中打开此 url(类似于 http://host:port/ddfdgfgd?wsdl)浏览器或下载到文件。
查找所有 WSDL 部分
portType
(portType 是类似 Java 接口)。所有 WSDL 端口类型都包含链接到输入/输出消息的操作。这些消息与 XSD 元素或类型链接(这取决于 SOAP 编码类型)。您还可以使用 wsimport 命令行工具使用 Java 导入 WSDL,并实现客户端或服务器端。
Just open this url to WSDL (looks like http://host:port/ddfdgfgd?wsdl) in your browser or download it to file.
Find all WSDL sections
portType
(portType is similar Java interface). All WSDL port types contains operations linked to input/output messages. These messages linked with XSD elements or types (it depends SOAP encoding type).Also you can import WSDL with Java with wsimport command line tool and implement client or server side.