关于查询而不是服务,最好、最全面的 SOAP 库是什么

发布于 2024-10-10 00:17:10 字数 290 浏览 0 评论 0原文

我的 google-fu 并没有为 java 中的 SOAP 库提供非常有希望的结果,它们主要用于设置 SOAP 服务,因为我需要与这样的服务进行通信。

我意识到 SOAP 只是构建和解析 XML 的问题,但理想情况下我希望对象映射和处理透明地完成。

到目前为止,我已经了解了 Apache Axis 和 X-Fire(现在是 Apache CXF),两者似乎都更多地处理提供 SOAP 服务,而不是实际使用 SOAP 服务。

谁能指导我处理 SOAP 的任何精华,或者有处理 Java 中 SOAP 服务的个人经验。

My google-fu is not turning up very promising results for a SOAP library in java, mostly they are for setting up SOAP services where as I need to communicate WITH such a service.

I realise that SOAP is just a matter of building and parsing XML but ideally I would like object mapping and handling done transparently.

So far I have looked at Apache Axis and X-Fire (now Apache CXF) and both seem to deal more with serving SOAP services than actually working with SOAP services.

Could anyone guide me to any gems for dealing with SOAP or have personal experience dealing with SOAP services in Java.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

千と千尋 2024-10-17 00:17:11

要查询 SOAP 服务,您可以使用 JAX-WS 标准的实现,例如 Project Kenai 或 JDK 6+ 中包含的默认版本。

本文展示了使用以下命令设置 SOAP 客户端(而不是服务器)的示例标准。有了 WSDL,您应该能够为您的 客户端这是另一个示例。

For querying a SOAP service, you can use an implementation of the JAX-WS standard such as Project Kenai or the default version included in JDK 6+.

This article shows a sample of setting up a SOAP client (as opposed to a server) using the standard. Given a WSDL, you should be able to use standard tools for your client. This is another example.

暗恋未遂 2024-10-17 00:17:10

您提到的框架确实会生成客户端代码。
例如,对于 CXF 如何创建客户端
他们不仅部署 Web 服务。他们还提供客户端代码来使用它!
这个想法是,您运行相应的自动工具(用于 CXF 的 wsdl2java 或随 Java 一起提供的用于 jax-ws 的 wsimport)来解析服务的 WSDL 以及客户端存根和所需的工件将创建与网络服务进行通信。
然后,在您的代码中,您可以使用客户端存根与 Web 服务进行通信,而从 XML 到 java 类型的编组/解组则由框架透明地处理。
您还可以研究一下 JAX-WS,如果您想要一些简单的东西,您可以使用 SAAJ 将肥皂消息直接发送到 Web 服务端点。
在您提到的框架中,您应该研究涉及客户端存根生成和使用 Web 服务的部分

The frameworks you mention do produce client code.
E.g. for CXF How-to-create-client
They do not only deploy a web service.They provide client code to consume it as well!
The idea is that you run the corresponding automatic tool (wsdl2java for CXF or wsimport shipped with Java for jax-ws) to parse the service's WSDL and the client stubs and required artifacts to communicate with the web service will be created.
Then in your code you use the client stubs to communicate with the web service while the marshall/demarshalling from XML to java types is handled transparently by the framework.
There is also JAX-WS you can look into and if you want something simple you can use SAAJ to send soap messages directly to the web service endpoint.
In the frameworks you mention you should look into the parts that refer to client stub generation and consuming web services

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文