隨筆 - 7  文章 - 5  trackbacks - 0
          <2006年10月>
          24252627282930
          1234567
          891011121314
          15161718192021
          22232425262728
          2930311234

          目前在研究生階段,主要是做基于J2EE的web services

          常用鏈接

          留言簿(2)

          隨筆分類

          文章分類

          最新隨筆

          最新評論

          RESTful Web Services


          1. The Fundamental
          ?
          ???1.1 What’s REST?
          ????????????REST: REpresentational State Transfer?
          ????????????It’s an architecture style (the stateless client-server architecture), not a toolkit.?
          ???1.2 REST defined?
          ????????????●Resources are identified by uniform resource identifiers (URIs)?
          ????????????● Resources are manipulated through their representations?
          ????????????●Messages are self-descriptive and stateless?
          ????????????●Multiple representations are accepted or sent?
          ????????????●Hypertext is the engine of application state?
          ???1.3 Representation?
          ????????????Just think that a web page is a representationof a resource, and the customer can get the resource from the URLs. Clients can then request a specific representation of the concept from the representations the server makes available.?
          ???1.4 State?
          ?????????“State” means application/session state, maintained as part of the content transferred from client to server back to client.Application state is the information necessary to understand the context of an interaction.The "stateless" constraint means that all messages must include all application state.?
          ?????1.5 Transfer of state?
          ?????????●Connectors (client, server, cache, resolver, and tunnel) are unrelated to sessions?
          ?????????●State is maintained by being transferred from clients to servers and back to clients

          The Conclusion:
          ?
          ?????????So we can say that “REST is a post hocdescription of the Web”. Unsurprisingly, HTTP is the most RESTful protocol.?

          ????1.6 REST messages?
          ???????????REST can support any media type, but XML is expected to be the most popular transport for structured information, it can make a resource have as many representations as you need,The XmlHttpRequest object lets you do REST from insidea web page.Unlike SOAP and XML-RPC, REST does not really require a new message format; it’s just use URLs to transfer the messages as parameters.?
          ???1.7 Web based application?
          ??????????A Web-based application is a dynamically changing graph of?
          ?????????– State representations (pages)?
          ?????????– Potential transitions (links) between states?
          ???1.8 OOP on REST?
          ????????? Every useful data object has an address;Resources themselves are the targets for method calls; the list of methods is fixed for all resources.?
          ???1.9 REST and RPC?
          ????????????●REST is, in a sense, a species of RPC, except the methods have been defined in advance. REST is incompatible with "end-point" RPC. So REST is architecture not only a design style.?
          ????????????●Most RPC applications don't adhere to the REST philosophy.?
          ????????????●It’s possible to work with RPC-style tools to produce REST results.?
          ???1.10 POST on the REST attitude?
          ??????????There are two views on POST, the first is “POST lets you pass a whole lot of parameters and get something back, bypassing caches.”, and the other is “POST lets you create new resources that are related to old ones.” The second view is on the REST point.
          ?
          2. RESTful Web Services?
          ?????????In the web services world, REpresentational State Transfer (REST) is a key design idiom that embraces a stateless client-server architecture in which the web services are viewed as resources and can be identified by their URLs. The Java API for XML Web Services (JAX-WS) provides full support for building and deploying RESTful web services.?
          ???2.1 When to use REST?
          ????????????● The web services are completely stateless.?
          ????????????●A caching infrastructure can be leveraged for performance.?
          ????????????●The service producer and service consumer have a mutual understanding of the context and content being passed along.?
          ????????????●Bandwidth is particularly important and needs to be limited.?
          ????????????●Web service delivery or aggregation into existing web sites can be enabled easily with a RESTful style.
          2.2 How to build a RESTful Web Service?
          ?????????JAX-WS enables building RESTful endpoints through a javax.xml.ws.Provider interface in the API. Provider is a generic interface that can be implemented by a class as a dynamic alternative to a service endpoint interface (SEI).
          ?????? The two important annotations in development:
          ?????? 1. @WebServiceProvider (wsdl=”…….”)?? //wsdl can omit
          ?????? 2. @BindingType (value=HTTPBinding.HTTP_BINDING)?? //Must
          ??????
          Reference:
          ? 1. RESTful Web Services by Sameer Tyagi:?
          ????????????http://java.sun.com/developer/technicalArticles/WebServices/restful/?
          ??2. Publishing a RESTful Web Service with JAX-WS by Doug Kohlert:?????????????????????
          ??????????http://weblogs.java.net/blog/kohlert/archive/2006/01/publishing_a_re.html
          ?
          3. Make Your Service RESTFul by Robin Zou:?
          ??????????http://zouzhile.googlepages.com/basicrestful
          ?
          posted on 2006-10-14 15:26 Stefanie 閱讀(862) 評論(2)  編輯  收藏 所屬分類: web services

          FeedBack:
          # re: RESTful Web Services 2006-10-16 20:38 Robin Zou
          呵呵, 居然你都開java博客了! 慶祝你開張大吉, 上來頂一下: 頂!!!!!
          哈哈  回復  更多評論
            
          # re: RESTful Web Services[未登錄] 2008-05-10 14:50 user
          《RESTful Web Services中文版》官方網站(http://restfulwebservices.cn)提供《RESTful Web Services中文版》PDF電子版樣章下載。  回復  更多評論
            

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 贺兰县| 曲靖市| 从江县| 竹山县| 孟津县| 同德县| 宜兴市| 北碚区| 龙州县| 林芝县| 皮山县| 灌阳县| 都匀市| 洞口县| 中牟县| 古交市| 永登县| 丹江口市| 桐城市| 青田县| 合阳县| 分宜县| 买车| 信宜市| 顺义区| 巴东县| 阜新| 林州市| 德阳市| 库尔勒市| 新巴尔虎右旗| 东光县| 虹口区| 恩施市| 忻城县| 象州县| 驻马店市| 阳春市| 济阳县| 呼伦贝尔市| 保亭|