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?

javaweb-serviceswsdljax-wsjax-rpc

提问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

  1. The tool wsimportworks on a WSDLfile which is an XML document describing the web service.
  2. The tool wsimportdoes not care to the style of the service (RPC/DOCUMENT) as described in the WSDL.
  3. If the WSDL has RPC-style, it will generate the client stubs for consuming RPC-style web services and similarly for document-style.
  4. JAX-WS(which provides wsimport) 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.
  5. Here is an example ofusing wsimportfor generating JAX-RPC client.
  1. 该工具wsimport处理一个WSDL文件,该文件是描述 Web 服务的 XML 文档。
  2. 该工具wsimport不关心 WSDL 中描述的服务样式 (RPC/DOCUMENT)。
  3. 如果 WSDL 具有 RPC 样式,它将生成用于使用 RPC 样式 Web 服务的客户端存根,并且类似地用于文档样式。
  4. JAX-WS(它提供wsimport)提供(或者更确切地说能够生成)Web 服务的样式(RPC/文档),并且两者都可以很好地与相应类型的服务端点配合使用。
  5. 这里是一个例子使用wsimport用于产生JAX-RPC客户。

Hope this helps.

希望这可以帮助。