国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
關于REST - gshangyong - 新浪BLOG
關于REST
2006-04-17 18:17:51
  
REpresentational State Transfer(REST)  代表性狀態(tài)傳輸, 至今還是不大明白為什么起這個名字。
 
REST是WEB服務的一種架構,簡單的說就是通過HTTP協(xié)議提供XML數(shù)據(jù)。最常見的應用就是RSS
 
  • REST與SOAP(Simple Object Access Protocal, 簡單對象訪問協(xié)議)的比較

     1、從基本原理層次上來講,REST適合于面向資源的服務,服務提供方維護一組資源,并公開一組基本操作來執(zhí)行以下任務:

      檢索資源

      修改資源

      創(chuàng)建新資源

      刪除資源

     資源是他們關心的中心。

    而SOAP更適合于面向活動的服務,客戶端請求的每個活動的操作是他們關心的中心。

   2、從使用上來說,REST更簡單,更快速,而SOAP在安全性方面會有更多更好的方案供選擇

Flickr就是采用REST方式提供的 WEB SERVICES
 
 
Amazon95%的服務也采用該方式 
 

了解更多的WEB服務和SOAP 到http://www-128.ibm.com/developerworks/cn/webservices/

 

 

 

下面的文章介紹的比較詳細:

來源:http://searchwebservices.techtarget.com/qna/0,289202,sid26_gci823342,00.html

REST could burst SOAP‘s bubble

 

Simple Object Access Protocol (SOAP), today‘s de facto Web services communications protocol, and has come a long way since Microsoft first developed it in 1999. However, the latest Web services fad is an architecture called REST, or representational state transfer. First coined in a popular dissertation by eBuilt‘s Roy Fielding, REST is a distributed computing framework that stresses component interaction and scalability. SearchWebServices spoke with Roy Hoobler, director of Internet technologies for Net@Work Inc., about REST and its potential impact on Web services.

Is there a simple way to explain REST?
Hoobler: Here‘s the way (Amazon.com) is using REST. Typically, if I‘m building an XML application, usually I have to have the XML file on my machine. However, with most XML apps, that doesn‘t have to be the case because you can access the XML file through any valid URL. For instance, I can go out to your Web site and get an XML file and parse it on my machine.

If it‘s in a database, it has to be a local database. I can‘t connect directly to Amazon‘s database, and there‘s no way they‘re going to let me. So, they might have a SOAP service, or they might do a query through HTTP, which is what they‘re doing. What they‘re doing (with REST) is building an XML document on the fly and returning (database data) via HTTP. I can use that on my system, save it and process it. There‘s a lot I can do with that and I don‘t need SOAP, and I don‘t have to program anything.

Is it really that simple?
Hoobler: It‘s a very simple process. If someone has an XML file and they give me the URL for it, then I can download the content. There‘s almost no programming involved. Someone can upload a text file that‘s basically XML, and I can download it through the browser. It‘s a little more complicated than that, but not much.

SOAP is also rather slow compared to REST, because of the communication that‘s going on. When you‘re using REST, you‘re pulling that info just as if you were looking at a Web page on the site. It comes down really fast. With SOAP, there‘s a lot more transactional information moving behind the scenes.

So is REST more of a methodology than a specification?
Hoobler: It‘s a technique. Other sites that have used this are a lot of the blogger sites, Web log sites and such. They offer the same thing, but they use a method called RSS (Resource Site Summary). They offer almost the exact same thing but it‘s in RDF (Resource Developer Framework), which is an XML format. For instance, if I have a list of the links on my Web site to tell you about, all I have to do is give you a URL were you can download the info in RDF. So it‘s similar to REST and what Amazon‘s doing. It‘s like a very cheap subscription service. You wouldn‘t have to write a Web service. You can just go there and get the content.

Amazon.com is currently using a REST-style Web service to share product-pricing info with its reseller partners. What would it have to do if it used SOAP to do the same thing?
Hoobler: First, (Amazon.com) would have to implement a SOAP server. They‘d have to build that themselves, which can be complicated, or they could use a third party system. Once they have a SOAP server, end-users would have to build SOAP clients that can communicate with the SOAP server. There would be a lot of programming involved, and most people haven‘t used SOAP yet, so they‘d be left out. With technologies like REST or RSS, that kind of programming doesn‘t have to take place, and Web services don‘t take as much effort.

If it‘s so simple, why hasn‘t it caught on like SOAP has?
Hoobler: It‘s not as powerful. With REST, you‘re just grabbing content. There‘s not as much processing that needs to be done. You can do much more complex operations with SOAP. If Amazon needed to send me much more information, and then I wanted to process that info -- like in some bank transaction where I had to give them a lot of info -- and then they had to check it and continue the transaction a little bit longer, that‘s where SOAP is very good. REST has not taken off in the business world because [the] people actually building these big integration servers [think] it‘s not powerful enough and doesn?t do enough.

Can you give me an example?
Hoobler: If I‘m using REST, I might be able to get a Web site‘s list of stock tickers, but I can‘t get the values of those tickers. If I‘m using SOAP, I can get to the values, manipulate them, and then send the results of my calculations. Let‘s say I got the values from you, and I wanted to let you know that they‘re wrong. If I wanted to send you back something that says they‘re wrong, with REST that can‘t be done. With REST, you request information, you get it, and that‘s where it ends.

How easy or difficult is it to learn to work with REST, versus working with SOAP?
Hoobler: To work with SOAP, you really need some kind of infrastructure -- like from IBM or Microsoft -- that supports SOAP. Some third parties, like Cape Clear, offer SOAP implementations, but you have to have all that software installed and know that infrastructure. With REST, to display that information on a Web page, you have to know XML and XSLT, and a lot of platforms -- like WebSphere and all of those Java application servers -- have that built in, or it‘s very easy to add it on.

Going the other way, if you wanted to use SOAP, you‘d have to use the whole .NET framework, or you‘d have to use WebSphere Studio. You‘d have to use a hefty application, so it‘s an investment of time and money.

How can a company determine if it should be working with REST instead of SOAP?
Hoobler: I would say if a company‘s just working with content-oriented data, and you have not implemented SOAP, then REST is a very good way to start working with XML and start displaying syndicated content. If you‘ve implemented SOAP and the infrastructure is in place and you‘ve got programmers coming out your ears, then you don‘t need to use REST.

本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
REST和SOAP:誰更好,或者都好?
[收藏]REST WebService與SOAP WebService的比較
Java開發(fā)中經(jīng)常使用到的幾種WebService技術實現(xiàn)方案
與Java Web Service相關的若干概念(JAX-WS,JAX-RS)
實戰(zhàn)分享 | API 接口滲透測試
REST vs Web Service
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服