REST assured A generic approach to REST EMEA PUG Challenge, 20-11-2014 Bronco Oostermeyer.

Slides:



Advertisements
Similar presentations
12 October 2011 Andrew Brown IMu Technology EMu Global Users Group 12 October 2011 IMu Technology.
Advertisements

REST Vs. SOAP.
Server Access The REST of the Story David Cleary
With ColdBox and REST. Co-Manager of IECFUG Flex, ColdFusion, JavaScript Developer A member of Team ColdBoxPresident of Sercossa Inc.
RESTful Web Services Senthil Chinnaiyan, Senior Architect
Building RESTful Interfaces
Introduction to Web Services and Web API’s Richard Holowczak Baruch College December, 2014.
INTRODUCTION TO ASP.NET MVC AND EXAMPLE WALKTHROUGH RAJAT ARYA EFECS - OIM DAWG – 4/21/2009 ASP.NET MVC.
REST support for B2B access to your AppServer PUG Challenge Americas Michael Jacobs : Senior Software Architect Edsel Garcia : Principal Software.
ADVANTAGE WEBAPI PETER FUNK SOFTWARE ENGINEER, ADVANTAGE R&D MAY 20, 2011.
Inside the JSDO: Mobile and Web
Scale Up Access to your 4GL Application using Web Services
Servlets and a little bit of Web Services Russell Beale.
.NET Framework V3.5+ & RESTful web services Mike Taulty Developer & Platform Group Microsoft Ltd
INNOV-3: Mashup Basics or > 2 Sheldon Borkin VP Technology Rick Kuzyk Sr Portfolio Specialist.
Peoplesoft: Building and Consuming Web Services
Interaction & Transactional Services Interaction & Transactional Services Silverlight Client HTML + XAP Web Browser Site Of Origin Web Server Web.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Performance testing of Progress Appservers and a plug-in for Jmeter
RESTful Web Development With Nodejs and Express. REST Stands for REpresentational State Transfer Has the following constraints: ◦Client-Server ◦Stateless.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com ICOM 5016 – Introduction.
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control Maarten
Designing and Implementing Web Data Services in Perl
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
Developing Reporting Solutions with SQL Server
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
CSCI 6962: Server-side Design and Programming Web Services.
Python and REST Kevin Hibma. What is REST? Why REST? REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a.
1 Dr Alexiei Dingli Web Science Stream Introducing Rails.
Or, Hey can’t we just do it using HTTP for the envelope?
Nadir Saghar, Tony Pan, Ashish Sharma REST for Data Services.
WebServices, GridServices and Firewalls Matthew J. Dovey Technical Manager Oxford e-Science Centre
Introduction to the SharePoint 2013 REST API. 2 About Me SharePoint Solutions Architect at Sparkhound in Baton Rouge
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
1 Seminar on Service Oriented Architecture Principles of REST.
API Crash Course CWU Startup Club. OUTLINE What is an API? Why are API’s useful? What is HTTP? JSON? XML? What is a RESTful API? How do we consume an.
2007cs Servers on the Web. The World-Wide Web 2007 cs CSS JS HTML Server Browser JS CSS HTML Transfer of resources using HTTP.
INT-9: Implementing ESB Processes with OpenEdge ® and Sonic ™ David Cleary Principal Software Engineer.
RESTful Web Services What is RESTful?
Developing SQL Server 2000 Reporting Services Applications Brian Welcker Group Program Manager SQL Server Reporting Services Microsoft Corporation.
Web Services Martin Nečaský, Ph.D. Faculty of Mathematics and Physics Charles University in Prague, Czech Republic Summer 2014.
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.
Google Code Libraries Dima Ionut Daniel. Contents What is Google Code? LDAPBeans Object-ldap-mapping Ldap-ODM Bug4j jOOR Rapa jongo Conclusion Bibliography.
Web Cache. What is Cache? Cache is the storing of data temporarily to improve performance. Cache exist in a variety of areas such as your CPU, Hard Disk.
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.
Google Analytics Graham Triggs Head of Repository Systems, Symplectic.
Using Retrofit framework in implementation of Android REST client David Ante Macan*, Zlatko Stapić, Milan Pavlović* University of Zagreb Faculty of Organization.
The Client-Server Model
API (Application Program Interface)
Node.js Express Web Applications
REST: Web Services Abel Sanchez.
Node.js Express Web Services
CMPE 280 Web UI Design and Development October 24 Class Meeting
SharePoint-Hosted Apps and JavaScript
Ashish Pandit IT Architect, Middleware & Integration Services
Power-UP YOUR UI WITH WP-API AND REACT.JS
Testing REST IPA using POSTMAN
WEB API.
Lecture 1: Multi-tier Architecture Overview
$, $$, $$$ API testing Edition
Module P3 Practical: Building a webapp in nodejs and
Python and REST Kevin Hibma.
Techniques to Invoke Web Services from SAS
Consuming Web Services with 2E Generated Objects
WCF Data Services and Silverlight
.NET Framework V3.5+ & RESTful web services
Chengyu Sun California State University, Los Angeles
Presentation transcript:

REST assured A generic approach to REST EMEA PUG Challenge, Bronco Oostermeyer

Who am I? {"speaker": [ { "id": 1, "firstName": "Bronco", "lastName": "Oostermeyer", "company": "Flusso", "previous": "UNIT4,Progress,WALVIS", " ": } ]}

Agenda -REST Adapter / Service types -Architecture -Why? -Steps -Code

REST REST = Representational State Transfer Architecture, not a protocol Definitely not a standard To the point Data transport via HTTP(S) Data via JSON (JavaScript Object Notation) Accessible from every technology “WebServices without SOAP overhead”

REST adapter - implementation PSDOE installed Tomcat

REST Adapter – Servicetypes REST Services GET: Very flexible DIY (Do It Yourself) Mobile Service GET: Standard CRUD support Service contract via catalog (to the client) Clientside JSDO available

REST Services - preliminary PDSOE “obligatory”! Essential for your workflow Test client (Postman, SOAP UI) Tools (Fiddler)

High over architecture Routing Mapping Business Logic IRestBackendConnector implementation Service war OpenEdge AppServer GenericYour application IRestBackendConnector REST adapter

Why? Separate generic REST related logic HTTP return codes Access paths HTTP Headers Routing Access application via 1 interface Web frameworks work well with REST Easier collaboration

Steps GET GET Create a ABL Router class interface methods Define service (interface) Create routing Create BackEndConnector

RestRouter Defines interface(s) for REST adapter to communicate with (CRUD) Implements (part of) logic for forwarding request to BusinessLogic Collects all info for response Data HTTP return value (codes 200, 404, 500 etc) (errors)

RestRouter (2) The methods:

REST Service definition Define the name, resources/verbs Path GET: Read, POST: create, PUT: update, DELETE: … : / /rest/ / Sample: (that’s long…)

REST Service definition (2) File  New  REST Service

REST Service definition (3)

REST Service definition (4) Map Resource / verb to method in class: GET /api/router/{resource} bfv.rest.RestRouter:GetResources()

REST Service definition (5)

REST Service definitions (6)

Now for real

Factory The factory maps the incoming resource (speaker) to: The REST class The application logic class Factory class acts a static façade for ResourceFactory And casts a Progress.Lang.Object to IRestRequest Get its info from XML ( config/factory.xml )

Factory (2) method public static IRestRequest GetRestReader(resourceName as character): return cast(GetResource(resourceName), IRestRequest). end method.

IRestRequest

Flow

RestBusinessEntity General implementation Supports all the basic patterns for CRUD on a resource Can be inherited from for more specific use cases Specfic JSON output

Flow (2)

IBackendConnector Interface which defines what is needed to make the generic stuff work with an application The realization of this interface should part of application The class which implements the interface should be stated in the factory xml

Pros & Cons Pro Limited set of URL’s Making new resource available is easy Abstract the REST stuff from application Easy to implement more behavior (logging, tracing, etc) Con No specific WADL’s

Caveats Request query parameters via ServletRequest [ {"theName":"AuthType"}, {"theName":"ContextPath","theValue":"\/router\/speaker"}, {"theName":"Method","theValue":"GET"}, {"theName":"PathInfo","theValue":"\/router\/speaker"}, {"theName":"PathTranslated","theValue":"C:\\bin\\tomcat\\oe113\\webapps\\pugapp\\router\\speaker"}, {"theName":"QueryString","theValue":"user=bronco&role=dev"}, {"theName":"RemoteUser"}, {"theName":"RequestedSessionId","theValue":" F702F64D2FB30FF2F379EFA"}, {"theName":"RequestURI","theValue":"\/pugapp\/rest\/api\/router\/speaker"}, {"theName":"RequestURL","theValue":" {"theName":"ServletPath","theValue":"\/rest"} ]

Deploying, architecture REST adapter Webserver OpenEdge AppServer Use a webserver in front of Tomcat Acts as reverse proxy (increased security) Port 443 possible (avoid 80) Hides Tomcat URLs except those you want to expose Shorten URLs vs Nginx, Apache, IIS (if you have to) Put Node.js in between?! Authentication via various providers All sort of cool connections to outside world

The code Not a complete solution, just inspiration to extend yourself Mercurial development repository: GIT: MIT license

“to do” PDSOE setup Authentication (worth separate presentation) Error handling Deployment

Clients? Anything which can talk HTTP HTML5! Angular Googles structural framework for dynamic web apps Session today at 16:45 Düsseldorf room by Maarten de Groot & Roel Lakenvelt

Questions?

follow us on:

Links (academic) (practical)