隨筆 - 7  文章 - 5  trackbacks - 0
          <2008年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          目前在研究生階段,主要是做基于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博客了! 慶祝你開張大吉, 上來頂一下: 頂!!!!!
          哈哈  回復(fù)  更多評論
            
          # re: RESTful Web Services[未登錄] 2008-05-10 14:50 user
          《RESTful Web Services中文版》官方網(wǎng)站(http://restfulwebservices.cn)提供《RESTful Web Services中文版》PDF電子版樣章下載。  回復(fù)  更多評論
            

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 天台县| 白城市| 黑河市| 清水县| 普宁市| 鄢陵县| 安多县| 邵阳市| 云阳县| 河源市| 垫江县| 公主岭市| 休宁县| 广宁县| 铁力市| 景谷| 武鸣县| 平乡县| 枣庄市| 尼玛县| 大名县| 仪陇县| 神木县| 石家庄市| 九龙城区| 邵阳市| 长宁县| 鹤山市| 三亚市| 武功县| 抚宁县| 瑞安市| 嵊州市| 响水县| 博爱县| 龙岩市| 阿荣旗| 朝阳区| 綦江县| 株洲县| 永年县|