`
csbison
  • 浏览: 150145 次
  • 性别: 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 WebServices中文版 完整清晰版

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

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

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

    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 ...

    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 ...

    RESTful Web Services Cookbook 中文版

    RESTful Web Services Cookbook 中文版,Web开发人员必备良药

    Django RESTful Web Services epub

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

    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删除 查看此书详细信息请在美国亚马逊官网搜索此书

    Building RESTful Web Services with .NET Core [PDF]

    Table of Contents ...Chapter 9 Scaling RESTful Services (Performance of Web Services) Chapter 10 Building a Web Client (Consuming Web Services) Chapter 11 Introduction to microservices

    Building RESTful Web Services with PHP 7 epub

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

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

    讲解REST与面向资源的架构(ROA)的概念与原理,如何编写符合REST风格的Web 2.0应用。仅用学习使用,不可用于商业用途,如有版权问题,请联系删除!

    Building RESTful Web Services with PHP 7_Code 源码

    Building RESTful Web Services with PHP 7_Code 源码 本资源转载自网络,如有侵权,请联系上传者或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 Java Web Services

    RESTful Java Web Services, Master core REST concepts and create RESTful web services in Java, Jose Sandoval, Copyright 2009 Packt Publishing

    RESTful Web Services Cookbook 中文免费版

    《RESTful Web Services Cookbook》的出现正好弥补了这一空缺,书中包含了大量与设计、实现RESTful Web服务相关的内容,它们都是在日常的设计和开发过程中会经常遇到的东西。本书采用了HTTP报文作为范例,而非具体的...

    Building RESTful Web Services with Java EE 8

    Building RESTful Web Services with Java EE 8 is a comprehensive guide that will show you how to develop state-of-the-art RESTful web services with the latest Java EE 8 APIs. You will begin with an ...

    RESTful Web Services Cookbook

    You'll learn ways to design RESTful web services for client and server applications that meet performance, scalability, reliability, and security goals, no matter what programming language and ...

Global site tag (gtag.js) - Google Analytics