Introduction to Web Services

Slides:



Advertisements
Similar presentations
Pierre-Johan CHARTRE Java EE - JAX-RS - Pierre-Johan CHARTRE
Advertisements

18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
System Wide Information Management (SWIM)
Overview Environment for Internet database connectivity
12 October 2011 Andrew Brown IMu Technology EMu Global Users Group 12 October 2011 IMu Technology.
REST - Representational State Transfer
Service Oriented Architecture
REST Vs. SOAP.
REST Introduction 吴海生 博克软件(杭州)有限公司.
Building and using REST information services Rion Dooley.
Server Access The REST of the Story David Cleary
REST (Representational State Transfer)
WHO AM I? REST? Dissertation by Roy Fielding 2000 Architectural Styles and the Design of Network-based Software Architectures ReST = Representational.
Overview of Web Services
What are Web Services? How to use them?
31242/32549 Advanced Internet Programming Advanced Java Programming
Web Services Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
General introduction to Web services and an implementation example
Building RESTful Interfaces
Information Management NTU Web Services. Information Management NTU What Are Web Services? Semantically encapsulate discrete functionality Loosely coupled,
Service-Oriented Architecture INF 123 – Software architecture 1.
Web Services Darshan R. Kapadia Gregor von Laszewski 1http://grid.rit.edu.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
SOAP Quang Vinh Pham Simon De Baets Université Libre de Bruxelles1.
1 Introduction to XML. XML eXtensible implies that users define tag content Markup implies it is a coded document Language implies it is a metalanguage.
G O B E Y O N D C O N V E N T I O N WORF: Developing DB2 UDB based Web Services on a Websphere Application Server Kris Van Thillo, ABIS Training & Consulting.
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Web Services Michael Smith Alex Feldman. What is a Web Service? A Web service is a message-oriented software system designed to support inter-operable.
Web Architecture & Services (2) Representational State Transfer (REST)
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
Prepared By : Monika Darji Web Services using REST & JAX-WS.
RESTful applications Norman White. REST Representational state transfer Key concepts – Client Server architecture built on transferring resources between.
Networks – Network Architecture Network architecture is specification of design principles (including data formats and procedures) for creating a network.
1 HKU CSIS DB Seminar: HKU CSIS DB Seminar: Web Services Oriented Data Processing and Integration Speaker: Eric Lo.
Web Services XML-RPC, SOAP, REST Advanced Web-based Systems | Misbhauddin.
Lecture 15 Introduction to Web Services Web Service Applications.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
XML Web Services Architecture Siddharth Ruchandani CS 6362 – SW Architecture & Design Summer /11/05.
1 Seminar on Service Oriented Architecture Principles of REST.
Representational State Transfer (REST). What is REST? Network Architectural style Overview: –Resources are defined and addressed –Transmits domain-specific.
RESTful Web Services What is RESTful?
Simple Object Access Protocol
REST By: Vishwanath Vineet.
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
Representational State Transfer COMP6017 Topics on Web Services Dr Nicholas Gibbins –
Software Architecture Patterns (3) Service Oriented & Web Oriented Architecture source: microsoft.
Java Web Services Orca Knowledge Center – Web Service key concepts.
Introduction to Web Services
Sabri Kızanlık Ural Emekçi
WEB SERVICES.
REST- Representational State Transfer Enn Õunapuu
Unit – 5 JAVA Web Services
GF and RS, Dept. of CS, Mangalore University
Advanced Web-based Systems | Misbhauddin
Representational State Transfer
WEB API.
$, $$, $$$ API testing Edition
Distributed Systems through Web Services
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
REST APIs Maxwell Furman Department of MIS Fox School of Business
RESTful Web Services.
REST på Microsoft-stacken
A gentle introduction to RESTful APIs
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Introduction to Web Services By J. H. Wang Nov. 28, 2011

Outline Overview RESTful Web services

What is a Web Service “a method of communication between two electronic devices over the Web” From Wikipedia entry on “Web service” “a software system designed to support interoperable machine-to-machine interaction over a network” From W3C definition

Two major classes of Web services An interface described in a machine-processable format (WSDL, or Web Services Description Language) Other systems interact with the Web service using SOAP messages, typically conveyed using XML/HTTP and other Web-related standards SOAP: Simple Object Access Protocol Two major classes of Web services REST-compliant To manipulate XML representations of Web resources using a uniform set of “stateless” operations Arbitrary

Web Services Architecture

Simple Object Access Protocol (SOAP) A protocol for exchanging structured information in the implementation of Web Services XML: for message format HTTP, SMTP: for message transmission

SOAP Message POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: 299 SOAPAction: "http://www.w3.org/2003/05/soap-envelope" <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header> </soap:Header> <soap:Body> <m:GetStockPrice xmlns:m="http://www.example.org/stock"> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope>

Web APIs Moving from SOAP based services to REST based communications REST: Representational State Transfer Do not require XML, SOAP, WSDL Typically a defined set of HTTP request messages along with the structure of response messages expressed in XML or JSON format JSON: JavaScript Object Notation They allow the combination of multiple Web services into new applications known as mashups

Web Services in a Service-Oriented Architecture

Three Most Common Styles of Use RPC (Remote Procedure Calls) A distributed function call interface SOA (Service-Oriented Architecture) The basic unit of communication is a message, rather than an operation REST (Representational State Transfer) Standard operations in HTTP: GET, POST, PUT, DELETE Interacting with stateful resources, rather than messgaes or operations

RPC Web Services Basic unit: WSDL operation Widely deployed and supported, but not loosely coupled Other approaches: CORBA, DCE/RPC, Java RMI

SOA Web Services Basic unit: message Supported by most major vendors, loose coupling

Representational State Transfer (REST) Interacting with stateful resources, rather than messages or operations Using HTTP standard operations such as GET, POST, PUT, DELETE WSDL 2.0 offers support for binding to all HTTP request methods WSDL 1.1 only GET and POST

Representation of concepts in WSDL 1.1 and 2.0 documents

Criticisms Too complex, not open source A custom interface requires a custom client for every service Concerns about performance due to XML and SOAP/HTTP in enveloping and transport

RESTful Web Services Introduced by Roy Fielding in his doctoral dissertation He is one of the principal authors of the HTTP specification version 1.0 and 1.1 Client-server Clients initiate requests Servers process requests and return appropriate responses Requests and responses are built around the transfer of representations of resources

Constraints Client-server Stateless Cacheable Layered system No client context is stored on the server between requests The server can be stateful Cacheable Clients can cache responses Layered system Clients cannot tell whether it’s connected directly to the end server, or an intermediary Code on demand (optional) Servers are able to temporarily extend the functionality of a client Uniform interface

Guiding Principles of the Interface Identification of resources E.g. URIs Manipulation of resources through these representations Self-descriptive messages Hypermedia as the engine of application state E.g. hyperlinks, hypertext

Key Goals Scalability of component interactions Generality of interfaces Independent deployment of components Intermediary components to reduce latency, enforce security, and encapsulate legacy systems

RESTful Web API Four aspects Base URI for the Web service Internet media type of the data supported by the Web service E.g. JSON, XML, or YAML The set of operations supported by the Web service using HTTP methods E.g. GET, PUT, POST, or DELETE The API must be hypertext driven

No official standard for RESTful services But Web standard protocols are often used

RESTful Web services: Basics Use HTTP methods explicitly Be stateless Expose directory structure-like URIs Transfer XML, JSON, or both

Using HTTP Methods Explicitly One-to-one mapping GET: to retrieve a resource on the server POST: to create a resource PUT: to change the state of a resource or to update it DELETE: to remove a resource For example, Before GET /adduser?name=Robert HTTP/1.1 After POST /users HTTP/1.1 Host: myserver Content-Type: application/xml <?xml version="1.0"?> <user> <name>Robert</name> </user>

Another example Before After GET /updateuser?name=Robert&newname=Bob HTTP/1.1 After PUT /users/Robert HTTP/1.1 Host: myserver Content-Type: application/xml <?xml version="1.0"?> <user> <name>Bob</name> </user>

Be Stateless For scalability, clients are required to send complete, independent requests include all data needed to be fulfilled so that the components in the intermediary servers may forward, route, and load-balance without any state being held locally in between requests

Expose directory structure-like URIs http://www.myservice.org/discussion/topics/{topic} http://www.myservice.org/discussion/2008/12/10/{topic} Guidelines Hide the server-side scripting technology file extensions (.jsp, .php, .asp), if any, so you can port to something else without changing the URIs Keep everything lowercase Substitute spaces with hyphens or underscores (one or the other) Avoid query strings as much as you can Instead of using the 404 Not Found code if the request URI is for a partial path, always provide a default page or resource as a response.

Transfer XML, JSON, or both Ex. <?xml version="1.0"?> <discussion date="{date}" topic="{topic}"> <comment>{comment}</comment> <replies> <reply from="joe@mail.com" href="/discussion/topics/{topic}/joe"/> <reply from="bob@mail.com" href="/discussion/topics/{topic}/bob"/> </replies> </discussion> Common MIME types JSON: application/json XML: application/xml XHTML: application/xhtml+xml

References http://en.wikipedia.org/wiki/Web_service RESTful Web services: the basics, by Alex Rodriguez, IBM developerWorks, available at: http://www.ibm.com/developerworks/webservices/library/ws-restful/.

Thanks for Your Attention!