将请求从一个 Web 服务转发到另一个 Web 服务
情况如下:
我有一个与 JAX-RPC Web 服务通信的应用程序(托管在 JBoss 服务器上的 .ear 包中)。我们需要将此 Web 服务中的所有操作转移到具有新名称的新服务,请记住,我们应该保持与具有旧 Web 服务存根的客户端的向后兼容性。我的想法是,我不应该保留两个 Web 服务中的操作逻辑,而是尝试将旧客户端的请求从旧 Web 服务转发到新服务。我找到了一个解决方案,但我不知道它的缺点是什么:我保留了旧 Web 服务中的操作框架,并在我的 ejbCreate() 中创建了新 Web 服务的 bean 实例,并且现在我所做的就是使用此 bean 实例调用新 Web 服务的操作(传递与从客户端接收到的相同参数,而不运行任何逻辑)。我的解决方案有效吗?还有更好的选择吗?
So the case is the following:
I have an application that communicates with a JAX-RPC web service (Hosted in an .ear package on a JBoss server). We had a requirement of moving all the operations in this web service to a new one with a new name, keeping in mind that we should keep our backward compatibility with clients with the old web service stub. The idea is that I shouldn't keep the logic of the operations in both web services, and instead, try to forward the requests for older clients from the old web service to the new one. I found a solution, but I don't know what are its downsides: I kept the skeleton of the operations in the old web service, and in my ejbCreate(), I created an instance of the bean of the new web service, and now all I do is invoking the operations of the new web service using this bean instance (passing the same arguments as received from the client without running any logic). Is my solution valid? Are there any better alternatives?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不使用 ws 寻址?你读过它吗? (老实说我从来没有使用过它,但我知道它可以用来代理请求)
why not to use ws-addressing? did you read about it ? (honestly I never used it, but I know it can be used to proxy requests)
旧线程,但对于其他谷歌用户来说,这是一个更好的答案:
查看膜-soa反向代理:http://www.membrane-soa.org/reverse-soap-proxy.htm
要解决有问题的确切问题,请检查此文档:http://www.membrane-soa.org/service-proxy -doc/4.0/soap-quickstart.htm
Old thread, but here is a better answer for fellow googlers:
Check out membrane-soa reverse proxy: http://www.membrane-soa.org/reverse-soap-proxy.htm
To solve the exact problem in question check this doc: http://www.membrane-soa.org/service-proxy-doc/4.0/soap-quickstart.htm