Programming for RESTful-SOA An introduction to building a SOA System with light-weighted RESTful Web Services (Web Services without SOAP or WSDL) Xiong.

Slides:



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

Give it a REST already Arnon Rotem-Gal-Oz VP R&D xsights
REST Vs. SOAP.
REST Introduction 吴海生 博克软件(杭州)有限公司.
Building and using REST information services Rion Dooley.
Introduction to Web Services
Server Access The REST of the Story David Cleary
RESTful Web Services Senthil Chinnaiyan, Senior Architect
General introduction to Web services and an implementation example
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
SOAP Quang Vinh Pham Simon De Baets Université Libre de Bruxelles1.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
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.
© 2011 IBM Corporation Overview on Modeling RESTful Services August, 2011 Manoj Paul, Software Developer, Rational,
Integrating Complementary Tools with PopMedNet TM 27 July 2015 Rich Schaaf
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
1 3. Implementing Web Services 1.Create SOAP proxy interfaces and WSDL based service descriptions 2.Register/publish services 3.Stores service descriptions.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
Dynamic Data Exchanges with the Java Flow Processor Presenter: Scott Bowers Date: April 25, 2007.
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
REST vs SOAP for Web Services Applications and Services in Internet Benjamin Hilaire – 81747L
Prepared By : Monika Darji Web Services using REST & JAX-WS.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Or, Hey can’t we just do it using HTTP for the envelope?
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
REST - Introduction Based on material from InfoQ.com (Stefan Tilkov) And slides from MindTouch.com (Steve Bjorg) 1.
Distributed Programming CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
RESTful Web Service 2014 년 12 월 한연희
Microservices with Spring Boot + Spring Data Using Spring Boot and Spring Data to quick develop HATEOAS microservices Bernardo Silva.
SNOWTAM Trial: REST Interface. AIXM XML Developers' Seminar 2 Contents Digital-SNOWTAM Trial Introduction REST Introduction REST in the Digital-SNOWTAM.
SNOWTAM Trial: REST Interface. AIXM XML Developers' Seminar 2 Contents Digital-SNOWTAM Trial Introduction REST Introduction REST in the Digital-SNOWTAM.
1 Seminar on Service Oriented Architecture Principles of REST.
2007cs Servers on the Web. The World-Wide Web 2007 cs CSS JS HTML Server Browser JS CSS HTML Transfer of resources using HTTP.
1 © Donald F. Ferguson, All rights reserved.Modern Internet Service Oriented Application Development – Lecture 2: REST Details and Patterns Some.
Representational State Transfer (REST). What is REST? Network Architectural style Overview: –Resources are defined and addressed –Transmits domain-specific.
Web Technologies Lecture 1 The Internet and HTTP.
Service Oriented Programming 1 Javier Espinosa, PhD
RESTful Web Services What is RESTful?
Web Services An Introduction Copyright © Curt Hill.
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
Lecture IV: REST Web Service
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
Google Code Libraries Dima Ionut Daniel. Contents What is Google Code? LDAPBeans Object-ldap-mapping Ldap-ODM Bug4j jOOR Rapa jongo Conclusion Bibliography.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
Feeling RESTful? Well, first we’ll define a Web Service –A web page meant to be consumed by a computer via an autonomous program as opposed to a web browser.
Creating REST Services with WCF and EF. About Me: Architect with CEI > concentration is ALM practice. 10 years experience developing with Microsoft Tools.
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
Representational State Transfer COMP6017 Topics on Web Services Dr Nicholas Gibbins –
CS520 Web Programming Introduction to Web Services Chengyu Sun California State University, Los Angeles.
Software Architecture Patterns (3) Service Oriented & Web Oriented Architecture source: microsoft.
XML 1. Chapter 8 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SAMPLE XML SCHEMA (XSD) 2 Schema is a record definition, analogous to the.
Using Retrofit framework in implementation of Android REST client David Ante Macan*, Zlatko Stapić, Milan Pavlović* University of Zagreb Faculty of Organization.
REST API Design. Application API API = Application Programming Interface APIs expose functionality of an application or service that exists independently.
National College of Science & Information Technology.
The Client-Server Model
WEB SERVICES.
REST: Web Services Abel Sanchez.
REST- Representational State Transfer Enn Õunapuu
Contents Digital-SNOWTAM Trial Introduction REST Introduction
Node.js Express Web Services
Applied Cyber Infrastructure Concepts Fall 2017
WEB API.
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
Web Server Design Week 16 Old Dominion University
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
CS4961 Software Design Laboratory Understand Aquila Backend
Week 05 Node.js Week 05
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Programming for RESTful-SOA An introduction to building a SOA System with light-weighted RESTful Web Services (Web Services without SOAP or WSDL) Xiong Haoyi Huazhong University of Science and Technology

Review of REST REST, means REpresentational State Transfer, was firstly raised by Roy Thomas Fielding in his doctoral thesis --“Architectural Styles and the Design of Network- based Software Architectures” ( University of California - Irvine , 2000 ) Rest, broadly used in the web applications, is considered as the basic architecture of web. The typical technologies based on REST include WebDAV, Resource-Oriented Web System etc.

Principles of RESTful Programming URI-Oriented Designing Linking Anything! Using the standard Methods of HTTP Multi-Representation of Resource Stateless Communication

URI-Oriented Designing Uniform Resource Identifier--”a compact string of characters used to identify or name a resource on the Internet.” URI could be the UUID for any Object in this world. The operations over resource could represent as the operations with the URI.

Example of URI and REST Index to distinct Customer’s Detail with customer id: Index to All Orders in the date of Example above Powered by Stefan Tilkov

HTTP Methods and Service Operations HTTP Methods including GET, POST, DELETE, PUT and HEAD, in some degree, could map to the CRUD actions which are the typical operations towards to resources. Service Operations, binding with semanteme of transcation, focus on the package of complex process and business activity.

REST vs RPC REST –Resources—Commands are defined in simple terms: resources to be retrieved, stored / get, set—difficult to do many joins RPC –Calling—Commands are defined in methods with varying complexity: depending on “standard”—easier to hide complex things behind a method REST –Nouns—Exchanging resources and concepts RPC –Verbs—Exchanging methods

REST in Action RestfulBeansServices, as the main result of our research, now is published as an open source software with the apache license on Google Code under the name of “RESTfulCRUDBeans” It is a Spring based framework deploying the Pojos as RESTful Web Services.

REST in Action Sample Code: Define a RESTful Web Service with annotation package org.lightechs.restfulbeans.sample; import org.lightechs.restfulbeans.annotation.*; /*Index to default Representation Transformer Defined in Spring beans*/ public class SampleRESTfulBean{ …… }

REST in Action Sample Code: Define a RESTful Web Service Operation with /*Reading with GET Designing*/ public String converter= "Int“ ) int i) { return “Hello!”+i; } … Invoke this operation with URI: GET hello/123 Accept: text /* if the accept fragment is invalid, the server would choose default one*/ Result of Server: Hello!123 (the result depends on the representation of ‘text’)

REST in Action Sample Code: Transformer Interface package org.lightechs.restfulbeans.transformer; import javax.servlet.http.HttpServletResponse; public interface transformer{ public void doTransformer(Object obj,HttpServletResponse response); /*Object means operation result, response means the HTTP response. Implements this method and define the way reflect in to response stream. */ }

REST in Action Sample Transformer,Transform String into stream package org.lightechs.restfulbeans.transformer; import javax.servlet.http.HttpServletResponse; import net.sf.json.*; ….. public void doTransformer(Object obj, HttpServletResponse response) { try{ String str=(String)obj; /*if obj is not instance of String, it will throw cast exception to container*/ response.setContentType(“plain/text; charset=utf-8"); PrintWriter pw=reponse.getWriter(); pw.write(str); Pw.close(); }catch(IOException e){ e.printStack(); } …..

REST in Action Sample Code: Single String Converter Interface package org.lightechs.restfulbeans.converter; public interface SingleStringConverter extends ConvertInterface{ public Object convert(String str); /*str means the part of URI such as “ The part named ${id} would convert int to Object as your wish by implementation of this method. */ }

REST in Action Sample Converter, Covert String into Integer package org.lightechs.restfulbeans.converter; public class Str2Integer implements SingleStringConverter{ public Object convert(String str) { return new Integer(str); /*if this str is not in the format of integer the methods would throws exception to container*/ }

REST in Action Sample Multi-String Converter, Covert Strings into File package org.lightechs.restfulbeans.converter; import java.io.File; public class MultiStr2FilePath implements MultiStringConverter{ public Object convert(String[] strs) {/*Multi-String convert Method*/ String temp=strs[0]; for(int i=1;i<strs.length;i++){ temp+=(File.pathSeparator+strs[i]); } File file=new File(temp); return file; } Eg: “ could index to native file of server side

REST in Action Annotation of this : the Parameter in URI :named parameter in query :Mutipart fragment of Http Request (eg. file :Mapping the URI with PathParams : firm default transformer for the service such as Json, TableList in sample source. could mapping the operation into GET,POST,PUT and DELETE Method.

Special RESTful Web Services QBE (Query By Example)! Asynchronous Message Queue

Query By Example URI-Query Mapping Original URI: GET db/STUDENT/hust/2005/ceee/ ACCEPT:NAME+CODE+AGE+SEX/COLLEGE+YEAR+DEPARTMEN T/X-JSON Mapped SQL: SELECT NAME, CODE, AGE, SEX FROM student WHERE COLLEGE=’hust’ AND YEAR=’2005’ AND DEPARTMENT='ceee’

Query By Example Database operationsRESTful-URI and MIME TypeMapped SQL updatePUT db/STUDENT/hust/001/Sam ACCEPT COLLE GE+CODE/NAME /X-JSON UPDATE STUDENT, SET NAME=’Sam’ WHERE COLLEGE=’hust’ AND CODE=’001’ insertPOST db/STUDENT/hust/2005/ceee/0 01/Sam ACCEPT COLLE GE+YEAR+DEPA RTMENT+CODE+NAME+SEX+A GE/X-JSON INSERT STUDENT( COLLEGE, YEAR, DEPARTMENT, CODE, NAME) VALUE (‘hust’,’2005’,’ceee’,’001’,’Sam’) deleteDELETE db/STUDENT/hust/00 1 ACCEPT COLLE GE+CODE/NAME /X-JSON DELETE FROM STUDENT, WHERE COLLEGE=’hust’ AND CODE=’001’

Asynchronous Message Queue Asynchronous Message Queue over keep-alive HTTP Connection The Server Response Content-type: multipart/mixed; boundary=”StudentMessage” --StudentMessage Content-type: X-JSON {code:”001”, name:”Sam”,age=20} --StudentMessage Content-type: X-JSON {code:”002”, name:”Lily”,age=20} --StudentMessage--

Introduction to Our Team Our team—LighTECHs which is a student team of HUST focus on Open-Source Java Web Container. Main Staffs of LighTECHs Xiong Hao-yi : System analyst, Architecture Leader Bie Rui : Sofware Designer, Chief Programmer He Lingli : Software Designer, Interrupter …….

Q&AQ&A