java 为 JAX-RPC Web 服务生成 JAX-WS 客户端存根?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12363438/
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
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 08:34:44 来源:igfitidea点击:
Generating JAX-WS client stubs for JAX-RPC web service?
提问by Arci
Will I be able to connect to a JAX-RPC web service using a JAX-WS (wsimport) generated client stub? What are the effects of consuming a JAX-RPC web service using a JAX-WS client? Are there any advantages and disadvantages?
我能否使用 JAX-WS (wsimport) 生成的客户端存根连接到 JAX-RPC Web 服务?使用 JAX-WS 客户端使用 JAX-RPC Web 服务有什么影响?有什么优点和缺点吗?
回答by Santosh
- The tool
wsimport
works on aWSDL
file which is an XML document describing the web service. - The tool
wsimport
does not care to the style of the service (RPC/DOCUMENT) as described in the WSDL. - If the WSDL has RPC-style, it will generate the client stubs for consuming RPC-style web services and similarly for document-style.
JAX-WS
(which provideswsimport
) provides (or rather capable of generating ) both the style (RPC/Document) of web services and both work equally well with respective types of service end points.- Here is an example ofusing
wsimport
for generating JAX-RPC client.
- 该工具
wsimport
处理一个WSDL
文件,该文件是描述 Web 服务的 XML 文档。 - 该工具
wsimport
不关心 WSDL 中描述的服务样式 (RPC/DOCUMENT)。 - 如果 WSDL 具有 RPC 样式,它将生成用于使用 RPC 样式 Web 服务的客户端存根,并且类似地用于文档样式。
JAX-WS
(它提供wsimport
)提供(或者更确切地说能够生成)Web 服务的样式(RPC/文档),并且两者都可以很好地与相应类型的服务端点配合使用。- 这里是一个例子使用
wsimport
用于产生JAX-RPC客户。
Hope this helps.
希望这可以帮助。