java 在 REST 服务中调用 SOAP 服务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33451259/
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-11-02 21:41:18  来源:igfitidea点击:

Calling SOAP service inside REST service

javaxmlrestsoaprestlet

提问by Shivam

I want to code for a REST service using Restlet framework that wraps a third party SOAP service with some XML data. So whenever I call the REST service with some XML data that REST service internally calls that third party SOAP service with the XML data that I provided and the response travels from that third party SOAP API to REST API and from REST API to me. I have gone through this questions;

我想使用 Restlet 框架为 REST 服务编写代码,该框架使用一些 XML 数据包装第三方 SOAP 服务。因此,每当我使用一些 XML 数据调用 REST 服务时,REST 服务在内部使用我提供的 XML 数据调用该第三方 SOAP 服务,并且响应从该第三方 SOAP API 传输到 REST API,再从 REST API 传输到我。我已经完成了这些问题;

Calling a SOAP service using REST service

使用 REST 服务调用 SOAP 服务

Calling SOAP in Jersey

在 Jersey 中调用 SOAP

But it didn't help me a lot, So it would be great if anyone provide me the links or tutorial where I can get any help. Thanks.

但这对我没有多大帮助,所以如果有人提供我可以获得任何帮助的链接或教程,那就太好了。谢谢。

回答by Thierry Templier

I think that the following links could help you if you want to implement by hand:

如果您想手动实施,我认为以下链接可以帮助您:

The key challenge here is to convert request elements into the SOAP request since SOAP only uses HTTP as a transport protocol (both headers and payload) and the same for response (extract headers and payload to build the REST response). With Restlet, you need to leverage its REST API for this. See this link: http://restlet.com/technical-resources/restlet-framework/guide/2.3/core/http-headers-mapping.

这里的关键挑战是将请求元素转换为 SOAP 请求,因为 SOAP 仅使用 HTTP 作为传输协议(标头和有效载荷)和相同的响应(提取标头和有效载荷以构建 REST 响应)。对于 Restlet,您需要为此利用其 REST API。请参阅此链接:http: //restlet.com/technical-resources/restlet-framework/guide/2.3/core/http-headers-mapping

I also saw these tools that seem to provide a proxy to adapt a SOAP service as REST service:

我还看到这些工具似乎提供了将 SOAP 服务适配为 REST 服务的代理:

Hope it helps you, Thierry

希望对你有帮助,蒂埃里