在现有SOAP Web服务上构建REST包装器 [英] Building REST wrapper over an existing SOAP web service

查看:178
本文介绍了在现有SOAP Web服务上构建REST包装器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队正在基于现有的基于SOAP的Web服务开发REST服务包装器。我们并不完全了解SOAP服务内部,只能访问WSDL文件。我们的REST服务包装器将只是一对一的映射。

My team is developing an REST service wrapper over an existing SOAP based web service. We don't exactly know the SOAP service internals, just have access to the WSDL file. Our REST service wrapper will be just one-to-one mapping.

我真的知道它不遵守REST哲学,即使请允许我称之为REST服务。这个REST服务将部署在Tomcat上,许多客户端将同时访问它。

I know in real its not adhere to REST philosophy, even though please allow me to call it REST services. This REST service will be deployed on Tomcat and many client will be accessing it concurrently.

当前的实现是每个客户端我们将创建一个代理对象(使用SOAP) WSDL代理类)。此代理对象将用于调用SOAP API。 SOAP需要在代理对象上绑定身份验证详细信息,因此我们在运行时为内存中的每个客户端保存这些对象,同时进行第一次REST调用以建立会话。

The current implementation is that for each client we will be creating an proxy object (using SOAP WSDL proxy class). This proxy object will be used to call the SOAP APIs. The SOAP requires authentication details binding over the proxy objects, so we are saving these objects for each client in memory at runtime while making first REST call to establish a session.

使用SessionID标识符在运行时获取保存的对象。现在问题是这些代理对象占用了大量内存块,只支持少量REST客户端。 (默认64 MB,只能运行19个REST客户端)。这是我们现在想要改变方法的麻烦,需要你的建议。

The saved object is fetched at runtime using an SessionID identifier. Now the problem is these proxy object occupy large memory chunks and only few REST clients are supported. (With default 64 MB only 19 REST clients can run). This is the trouble now we want to change the approach and would require your suggestions.

如果有更好的解决方案,请告诉我。我们不希望DB存储对象。

Kindly let me know if any better solution exists. We don't want a DB to store the objects.

推荐答案

如果您能做的就是调用HTTP / Soap服务并且无法访问代码,然后使用适当的REST约定创建REST服务,然后实现SOAP服务调用的转换。您可以从WSDL自动创建SOAP客户端类,这将节省您一些时间。

If all you can do is call a HTTP/Soap service and don't have access to the code then you create your REST services using proper REST conventions and then implement the translation to the SOAP service calls..you create the SOAP client classes automatically from the WSDL and that will save you some time.

但是你需要编写一个自定义的翻译层,不要制作一套hacky REST服务,并尝试将其融入SOAP模型中。尽量保持真实休息并使翻译层更加复杂......这将是值得的。

But you WILL need to write a custom translation layer and do not make a set of hacky REST services and try to fit it into the SOAP model. try to stay true to rest and make the translation layer more complicated..it will be worth it.

这篇关于在现有SOAP Web服务上构建REST包装器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆