SOAP webservice和RESTFUL webservice之间的区别 [英] Difference between SOAP webservice and RESTFUL webservice

查看:1181
本文介绍了SOAP webservice和RESTFUL webservice之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java的新手。我知道有两种类型的Web服务

I am new to Java.I know that there are two types of web service


  1. SOAP Webservice。

  2. RESTful Webservice。

任何人都可以告诉我他们两者之间的基本区别是什么。其中情况 SOAP Webservice 已创建,并且在这种情况下创建了 RESTful Webservice

can any one please tell me what is the basic difference between both of them.And in which situation the SOAP Webservice is created and in which situation RESTful Webservice is created.

谢谢,

推荐答案

正如第一个答案已经解释的那样,SOAP Web服务和REST Web服务在各个方面有所不同。

As the first answer allready explains, SOAP Webservices and REST Webservices differ in various points.

SOAP:


  • 您在.wsdl文件中定义接口,它描述了预期的输入参数以及返回值的外观。

  • 有一些工具可以用java类hirarchies生成.wsdl文件。 JAXB例如

  • 还有工具可以生成java对象/类作为eclipse的一部分示例(暂时不知道名称)。

  • SOAP非常严格。在处理之前,每个请求都是针对wsdl进行验证的。

  • you define your interface in a .wsdl file, which describes exactly which input parameters are expected and how the return values will look like
  • there are tools to generate the .wsdl files out of java class hirarchies. JAXB for example
  • there are also tools to generate java objects/classes as part of eclipse for example (don't know the name in the moment).
  • SOAP is very strict. Every request is validatet against the wsdl before processing.

一个好的但不太容易从SOAP WS框架开始是 Apache CXF

A good but not so easy to start with framework for SOAP WS is Apache CXF

REST(到目前为止还没有亲身体验,随时可以更正改进;)):

REST (no hands on experience up to now, feel free to correct and improve ;) ):


  • 一种访问网络服务器或网络应用程序以从中检索数据或向其发送数据的方法。

  • 它只是协商,如何访问它。

  • 常见的是这样的 http://server.domain.com/app/type/id=123 检索类型为id = 123的对象

  • 非常直观,但没有自动验证请求。

  • ...

  • a way to access a webserver or web application to retrieve data from or send to it.
  • it's only negotiated, how it is accessed.
  • common is something like this http://server.domain.com/app/type/id=123 to retrieve object of type type with id=123
  • very intuitive, but no automatic validation of requests.
  • ...

我相信,有我错过了其他几点。但我认为这是一个有用的开始。

I am sure, there are several other points I missed. But I think it's a usefull start.

这篇关于SOAP webservice和RESTFUL webservice之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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