Presentation is loading. Please wait.

Presentation is loading. Please wait.

Server Access The REST of the Story David Cleary Principal Software Engineer June 12, 2013.

Similar presentations


Presentation on theme: "Server Access The REST of the Story David Cleary Principal Software Engineer June 12, 2013."— Presentation transcript:

1 Server Access The REST of the Story David Cleary Principal Software Engineer June 12, 2013

2 © 2013 Progress Software Corporation. All rights reserved. 2 OE Mobile Tooling

3 © 2013 Progress Software Corporation. All rights reserved. 3 Rest Adapter Tooling

4 © 2013 Progress Software Corporation. All rights reserved. 4 OE Mobile Tooling

5 © 2013 Progress Software Corporation. All rights reserved. 5 Rest Adapter Tooling

6 © 2013 Progress Software Corporation. All rights reserved. 6 Agenda Why REST? REST Architectural Overview What is RESTful in the Progress World RESTing your Progress Servers Demo

7 © 2013 Progress Software Corporation. All rights reserved. 7 Key Takeaways Understanding of RESTful Application Principals Knowing when to REST or not What OpenEdge provides in 11.2 and later to REST

8 © 2013 Progress Software Corporation. All rights reserved. 8 Architecture or Protocol? HTTP HyperText Transfer Protocol Defines text-based message format and exchange protocol Foundation for communications in the cloud SOAP Simple Object Access Protocol Defines an XML-based message format and exchange protocol Specifies bindings to HTTP and other transports REST Representational State Transfer Style of software architecture for distributed systems Describes the architecture of HTTP Predominate web API design model

9 © 2013 Progress Software Corporation. All rights reserved. 9 REST Architecture There is no REST Specification REST does not define a message format REST does not define a message exchange protocol REST is stateless Each client request contains all the information to service the request REST is resource-based Resources are identified by URI (Uniform Resource Identifier) Server provides a representation of resource to client Client can manipulate resource on server through the representation CRUD Model Create, Read, Update and Delete

10 © 2013 Progress Software Corporation. All rights reserved. 10 What is a Resource?

11 © 2013 Progress Software Corporation. All rights reserved. 11 REST Web Services Uses HTTP as its protocol Resource identification through URI Uniform interface (GET, PUT, POST, DELETE) Typically uses JSON or XML as message format Every interaction with a resource is stateless

12 © 2013 Progress Software Corporation. All rights reserved. 12 RESTful Web Services vs. SOAP REST Resource based Lighter weight Can use JSON or XML Contract via documentation SOAP Procedural Contains more details Uses XML Contract via WSDL When to use SOAP Intranet applications – More mature tooling B2B applications – Strong contract Exposing existing applications When to use REST Cloud-based and mobile applications Creating highly scalable stateless applications

13 © 2013 Progress Software Corporation. All rights reserved. 13 Scientific Approach to Choosing

14 © 2013 Progress Software Corporation. All rights reserved. 14 Scientific Approach to Choosing

15 © 2013 Progress Software Corporation. All rights reserved. 15 Agenda Why REST? REST Architectural Overview What is RESTful in the Progress World RESTing your Progress Servers Demo

16 © 2013 Progress Software Corporation. All rights reserved. 16 Progress REST Support WebSpeed Supporting RESTful applications since 1997 No tooling support specific to REST – Developer must do everything OpenEdge Reference Architecture (OERA) Business Entities are resources AutoEdge a RESTful application OpenEdge REST Adapter Delivered as part of OpenEdge 11.2 Progress DataDirect Cloud

17 © 2013 Progress Software Corporation. All rights reserved. 17 OpenEdge Reference Architecture PresentationEnterprise Services Business Components Data Access Data Sources Common Infrastructure Workflow TaskEntity

18 © 2013 Progress Software Corporation. All rights reserved. 18 OpenEdge Reference Architecture PresentationEnterprise Services Business Components Data Access Data Sources Common Infrastructure Workflow TaskEntity

19 © 2013 Progress Software Corporation. All rights reserved. 19 AutoEdge

20 © 2013 Progress Software Corporation. All rights reserved. 20 OpenEdge REST Adapter Machine A Machine B Machine C HTTP Web Server OpenEdge Explorer / OpenEdge Management RESTMAN /command line Java container REST Management Agent REST Client #1 OpenEdge AppServer REST Application #1 OpenEdge AppServer REST Client #2 REST Client #3 REST Application #3 REST Application #2 Progress Developer Studio for OpenEdge

21 © 2013 Progress Software Corporation. All rights reserved. 21 Agenda Why REST? REST Architectural Overview What is RESTful in the Progress World RESTing your Progress Servers Demo

22 © 2013 Progress Software Corporation. All rights reserved. 22 Applications and Services Service - A collection of operations on a set of resources Create – Create a new resource Read – Retrieve an existing resource Update – Update an existing resource Delete – Delete an existing resource An OpenEdge REST Application supports one or more services Compiled into a Java WAR file

23 © 2013 Progress Software Corporation. All rights reserved. 23 The URL Space Protocol: HTTP DNS System Name: api-public.netflix.com Service Name: catalog Resource Name: titles URL Parameters: term=Ironman Additional information required HTTP Verb (GET, PUT, POST, and DELETE) Optional body Media type

24 © 2013 Progress Software Corporation. All rights reserved. 24 HTTP GET Retrieves a resource or resource locators identified by a URL Client identifies what media type[s] it wants via Accept header application/json only type supported currently by OpenEdge Input parameters specified in URL Path parameters URL Parameters Additional parameter support HTTP Headers Additional metadata from request context Does not support sending a body

25 © 2013 Progress Software Corporation. All rights reserved. 25 HTTP POST Creates a new resource on server Typically uses URL of parent resource Requires a body that represents resource OpenEdge limited to application/json Can support path and URL parameters OpenEdge supports mapping individual parameters extracted from a JSON body Returns representation of new resource if accepted by the server

26 © 2013 Progress Software Corporation. All rights reserved. 26 HTTP PUT Updates an existing resource on server Uses URL of resource, unlike POST Can create new resource at location specified by client, but not recommended Idempotent – Identical requests have same effect as a single request

27 © 2013 Progress Software Corporation. All rights reserved. 27 HTTP DELETE Deletes the resource identified on the server Also Idempotent

28 © 2013 Progress Software Corporation. All rights reserved. 28 Message Bodies Bodies must be JSON Map TempTables and Datasets directly to bodies Map CHARACTER and LONGCHARS to bodies Custom JSON objects Multiple parameters in body supported by request and response objects Input parameters extracted and passed to AppServer Output parameters added to response object Only one level deep

29 © 2013 Progress Software Corporation. All rights reserved. 29 HTTP DELETE Deletes the resource identified on the server Also Idempotent

30 © 2013 Progress Software Corporation. All rights reserved. 30 Message Bodies Bodies must be JSON Map TempTables and Datasets directly to bodies Map CHARACTER and LONGCHARS to bodies Custom JSON objects Multiple parameters in body supported by request and response objects Input parameters extracted and passed to AppServer Output parameters added to response object Only one level deep

31 © 2013 Progress Software Corporation. All rights reserved. 31 Service Interfaces Identify the entities you want to expose Map these entities to your URL space Determine what CRUD operations are applicable to what resources Document the representation of your resources Avoid verbs, but not at the cost of complexity

32 © 2013 Progress Software Corporation. All rights reserved. 32 Sessions and Identity Management Authentication, Authorization, and Session Management done at Web Server Uses Spring Security Framework 3.1 Supports internal and external authentication providers For production, you want stateful sessions Web Server sessions, not AppServer Done through JSESSIONID cookie Must use AppServer SSO if you want identity on AppServer Spring creates sealed ClientPrincipal

33 © 2013 Progress Software Corporation. All rights reserved. 33 Agenda Why REST? REST Architectural Overview What is RESTful in the Progress World RESTing your Progress Servers Demo

34 © 2013 Progress Software Corporation. All rights reserved. 34 CRM Application Resources Customers Orders CustomerOrders Techniques used Hyperlinks (Locators) HTTP Response Code Multiple parameter bodies

35 © 2013 Progress Software Corporation. All rights reserved. 35 CRM Application Resources Customers Orders CustomerOrders Techniques used Hyperlinks (Locators) HTTP Response Code Multiple parameter bodies

36 October 6–9, 2013 Boston #PRGS13 Special low rate of $495 for PUG Challenge attendees with the code PUGAM And visit the Progress booth to learn more about the Progress App Dev Challenge!

37


Download ppt "Server Access The REST of the Story David Cleary Principal Software Engineer June 12, 2013."

Similar presentations


Ads by Google