`
csbison
  • 浏览: 153547 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

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

分享到:
评论

相关推荐

    RESTful Web Services中文高清版.pdf.zip

    RESTful Web Services是一种广泛应用于现代Web开发中的设计模式,它基于Representational State Transfer(表述性状态转移)原则,旨在创建高效、分布式的网络应用程序。本资料《RESTful Web Services中文高清版.pdf...

    RESTful Web Services 中文版 高清 PDF 电子书

    根据提供的文件信息,我们可以提炼出关于RESTful Web Services的关键知识点: RESTful Web Services概念:RESTful Web Services是一种基于Web的架构风格和设计模式,用于构建可扩展和灵活的网络应用。REST即表现层...

    RESTful WebServices中文版 完整清晰版

    ·包含RESTful Web services的真实案例,如Amazon的简单存储服务与Atom发布协议等 ·探讨各种流行编程语言的Web services客户端 ·展示如何用三种流行框架实现RESTful services —— Ruby on Rails、Restlet(基于...

    RESTful Web Services 中文版

    RESTful Web Services 中文版,详细教程

    building restful web services with spring 5 2e

    Building RESTful Web Services with Spring 5 – Second Edition: Leverage the power of Spring 5.0, Java SE 9, and Spring Boot 2.0 Find out how to implement the REST architecture to build resilient ...

    restful web services中英文版以及书上源码

    RESTful Web Services是一种广泛采用的Web服务设计模式,它遵循Representational State Transfer(表述性状态转移)原则。这种设计风格使API(应用程序编程接口)更加简洁、可读性强且易于理解,尤其适合于互联网...

    RESTful Web Services Cookbook 中文版

    《RESTful Web Services Cookbook 中文版》是一本针对Web服务开发者的实用指南,它深入探讨了如何使用REST(Representational State Transfer)架构风格来构建高效、可伸缩且易于理解的Web服务。这本书旨在帮助...

    Building RESTful Web Services with Go

    Building RESTful Web Services with Go:Initially, SOAP-based web services became more popular with XML. Then, since 2012,REST picked up the pace and gulped SOAP in whole. The rise of a new generation ...

    Django RESTful Web Services epub

    Django RESTful Web Services 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书

    Django restful web services the easiest way to build python

    ### Django RESTful Web Services: The Easiest Way to Build Python #### 一、概述与背景 本书主要聚焦于如何利用Python及其最受欢迎的Web框架Django来构建RESTful Web服务。随着互联网技术的发展,RESTful Web...

    RESTful WebServices中文版.pdf 47M

    RESTful WebServices中文版.pdf 总共47M,我最多一次只能上传30M,不得不吧他压缩成两部分,这个是第一部分,第二部分下载地址:...下载完成后把文件名改成:RESTful WebServices中文版.part1.rar

    Building RESTful Web services with Go mobi

    Building RESTful Web services with Go 英文mobi 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书

    三步轻松实现java restful web services

    Java RESTful Web Services是开发现代Web应用程序的一种常见方式,它基于Representational State Transfer(REST)架构原则,提供了轻量级、高效且易于使用的接口。在本文中,我们将深入探讨如何分三步轻松实现Java ...

    Building RESTful Web Services with PHP 7 epub

    Building RESTful Web Services with PHP 7 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    Building RESTful Web services with Go

    Building RESTful Web services with Go pdf Book Description REST is an architectural style that tackles the challenges of building scalable web services and in today's connected world, APIs have taken ...

    Restful Web Services Cookbook

    根据提供的文件信息,我们可以提取并总结出《Restful Web Services Cookbook》一书中的关键知识点,主要围绕RESTful Web服务的设计原则、实现方法及其在不同场景下的应用展开。 ### 标题解析 - **《Restful Web ...

Global site tag (gtag.js) - Google Analytics