Spring 远程处理/网络服务技术 [英] Spring remoting/webservice technologies

查看:41
本文介绍了Spring 远程处理/网络服务技术的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Spring Framework 为应用程序通过 HTTP 相互通信提供了许多技术.

Spring Framework provides many technologies for applications to communicate with each other over HTTP.

  • HTTP 调用程序
  • RESTful MVC 控制器
  • JAX-WS
  • Spring-WS

它们之间有什么区别?什么标准决定选择哪一个?

What are the differences among them? What criteria dictate which one to choose?

推荐答案

JAX-WS 是由 JCP(Java 社区进程)维护的标准,并且每个功能齐全的应用服务器都实现了它(或者,至少,为它).它易于使用(您只需要在服务类端点中添加一些注释)并且您无需担心实现(并且您的应用程序将在其中携带更少的依赖项).

JAX-WS is a standard maintained by the JCP (Java Community Process) and every full featured application server implements it (or, at least, provides an implementation for it). It's easy to use (you just need a few annotations in your service class endpoint) and you don't need to worry about the implementation (and your application will carry less dependencies within it).

当 JAX-WS 还在开发中(或者根本不存在)时,Spring-WS 已经很普遍了.它实现了与 JAX-WS 相同的功能,但稍微麻烦一些.从我的经验来看,它正在失去对后者的好处的专家.

Spring-WS was widespread when JAX-WS was a work-in-progress (or didn't ever existed). It achieves the same that JAX-WS but it's a bit more cumbersome. From my experience it's loosing adepts in the benefit of the latter.

基于 HTTP 的服务(作为 HTTP 调用程序和 REST)声称比 JAX-WS 更轻量级(因为端点不需要处理 SOAP 信封),但不像基于 WSDL 的服务那样强类型.

HTTP based services (as HTTP invoker and REST) claim to be a bit more lightweight than JAX-WS (because the endpoints don't need to handle the SOAP envelope) but are not as strong-typed as WSDL based ones.

当我不得不选择时,如果基于 REST 的方法没有充分的理由,我通常会决定使用 JAX-WS.我根本不喜欢 HTTP Invoker 的因为它是安全问题(即使在谈论内部网时),但我认为这是一种个人选择.

When I have to choose I usually decide for JAX-WS if there is not a strong reason for the REST based approach. I don't like at all the HTTP Invoker one because it's security issues (even though when talking about intranets), but I think this is a kind of personal choice.

这篇关于Spring 远程处理/网络服务技术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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