Presentation is loading. Please wait.

Presentation is loading. Please wait.

CON7553 PeopleTools REST Web Services: Everything You Need to Know Graham Smith - OXFAM GB PeopleSoft Technical Lead & System Architect.

Similar presentations


Presentation on theme: "CON7553 PeopleTools REST Web Services: Everything You Need to Know Graham Smith - OXFAM GB PeopleSoft Technical Lead & System Architect."— Presentation transcript:

1 CON7553 PeopleTools REST Web Services: Everything You Need to Know Graham Smith - OXFAM GB PeopleSoft Technical Lead & System Architect

2 Page 2 Oxfam Oxfam is a vibrant global movement of dedicated people fighting poverty 70 years experience in 94 countries Syria - Helping over 200,000 refugees

3 PeopleSoft @ OXFAM HCM & FSCM Applications 4,500+ users in 70+ countries Working on 9.2 upgrade to FSCM

4 Agenda 1) What is a web service 2) What is SOAP & REST 3) What is WSDL and WADL 4) What is XML and JSON 6) Configuring PeopleTools for REST 7) What's delivered in a SYS database that works 8) How to Build a REST service 9) Testing tools 10) Security 11) Demo 12) Questions

5 Page 5 What is a Web Service? Method of communicating between devices over the world wide web Characteristics of a web service Defined interface in machine readable form (WSDL or WADL) Conveyed over HTTP/S Systems interact using request / response messages (SOAP or REST)

6 Page 6 Introduction to REST Style of doing Web Services Defined by Professor Roy Fielding @ UC Irvine in 2000 Co-founder of Apache HTTP Server Principal author of HTTP specification Emerging as the predominant web API model Lighter weight and easier to use compared to SOAP and others Available from PeopleTools 8.52

7 Page 7 What is SOAP & REST? Both are used to access Web Services One is a protocol (SOAP) with defined specification http://www.w3.org/TR/soap/ http://www.w3.org/TR/soap/ One is an architectural style (REST)

8 Page 8 What is SOAP? SOAP Simple Object Access Protocol SOAP Version 1.2 is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment TECHNOLOGY SPECIFICATION (W3C in 2033) Requires custom methods (e.g. getCustomerName ) Uses HTTP POST method to send XML messages Designed for distributed transactions Extensible model (WS-Security, WS-Routing, etc) Asynchronous and Synchronous communication possible Built in error handling

9 Page 9 What is REST? REST REpresentational State Transfer ARCHITECTURAL STYLE (not a standard) Implements standard HTTP operations ( GET, POST, PUT, DELETE ) Used to locate and return the representation of a resource (URI) No XML to parse and process (fast) Synchronous communication only Stateless Easier to implement

10 Page 10 What is WSDL & WADL? WSDL Web Services Description Language XML to describe SOAP web service Can define both SOAP and REST web services (from WSDL 2.0) PeopleTools describes SOAP based service W3C Recommendation 2007 WADL Web Application Description Language XML to describe REST web services PeopleTools describes REST services using WADL W3C Submission in 2009 by Sun Microsystems Limited tooling support

11 Page 11 What is XML & JSON? XML eXtensible Markup Language JSON JavaScript Object Notation JSON now supported PeopleTools 8.53

12 Page 12 Configuring PeopleTools for REST Set REST Target Locations in Service Configuration Specify optional node name Target URL

13 Page 13 Configuring PeopleTools for REST Activate ~~Any~~ to Local Routing on GETWADL Service Op

14 Page 14 Configuring PeopleTools for REST Set default application server in Gateway Setup Properties Check and set PeopleTools version (inc. Patch number)

15 Page 15 Delivered Example in SYS database Service Operation PTLOOKUPXLAT_REST_GET Returns XLAT values for a given Fieldname. Handler App Package PT_IB_LOOKUPREST From 8.53 this is implemented as REST based service. An error may occur in the Handler code if Earlier than 8.53.06

16 Page 16 PT_LOOKUPXLAT_REST_GET http://server/PSIGW/RESTListeningConnector/PTLOOKUPXLAT_R EST.v1/XLAT_Lookup/RUNSTATUS?fieldVal=7

17 Page 17 REST URI - Uniform Resource Identifier Identifies the name of a web resource http://myserver/orders/data.html er feufhefherf her hfer fherhferfher heihfwe ew ew ew ew ew dwe dwedew dwe ew dewdwe ewwe dew wewedew weew weewdwe ewwdewdwe ew dew weewewweew dwe dewdewdewdewewd ewdewdewdewdwe

18 Page 18 REST URI - Uniform Resource Identifier REST operates in a similar way to the WWW http://myserver/operators http://myserver/opeators/oprid=VP1 oprid xxxxxxxxxxxx VP1 xxxxxxxxxxxxxx

19 Page 19 REST URI – Resource Templates http://myserver/operators http://myserver/operator/oprid=VP1 Resource name RESOURCE TEMPLATES

20 Page 20 REST URI – Resource Document http://myserver/operators/oprid=VP1 /operators/oprid={oprid} Template Mapping by element name

21 Page 21 How to Build a REST Web Service 1.Create Document 2.Test Document 3.Create Message 4.Create Service 5.Create Handler 6.Create Service Operation a)Resource Template 7.Test Handler 8.Create Routings 9.Test Service Operation 10.Publish Web Service (if WADL is needed) Using delivered image FSCM 9.2.002.

22 Page 22 Message REST Web Service Components REST Service Service Operation Resource Definition URI Template(s) Document Template Response Message (20 Fault Message (400) Handler (OnRequest) Service Operation Resource Definition URI Template(s) Document Template Response Message (200) Fault Message (400) Response Document Resource Document

23 Page 23 Example REST Service Return the name and email address of a given operator. Service = OOW_OPERATOR Service Operation = OOW_OPERATOR_GET http://myserver/operator/vp1 Application Designer project OOW_REST Download from http://goo.gl/KUX9F2

24 Page 24 1) Documents Definition Define hierarchical data structures (logical) Map onto physical structures XML JSON Database records and fields Data types available PRIMITIVE = string, char, integer, etc COMPLEX PRIMITIVE = primitive with attributes COMPOUND = set of one or more primitives COLLECTION = set of one or more compounds

25 Page 25 1) Document Data Types ROOT element Collection Record Compound Primitive Complex Primitive Compound

26 Page 26 1) Documents Needed Document Template Used to retrieve inbound URI parameters Cannot contain COMPOUND types Supports direct variable substitution Request Document/Message Only required if using POST method Response Document Used to construct return message to client Fault Document (optional) Used to construct return message on error condition They can be all the same document or different ones

27 Page 27 1) Create Document

28 Page 28 1) Create Document – Relational Allows mapping of document elements to PeopleSoft records and fields.

29 Page 29 2) Document Tester

30 Page 30 2) Document Tester - XML

31 Page 31 2) Document Tester - JSON

32 Page 32 2) Document Tester - PeopleCode

33 Page 33 2) Document Tester – Create XSD

34 Page 34 3) Create Message The DOCUMENT is not enough. A message of type Document must be created.

35 Page 35 4) Create Service

36 Page 36 5) Create Handler 1.Create an Application Class that implements PS_PT:Integration:IRequestHandler 2.Create document from inbound URI Local Document &oprDoc = &_MSG.GetURIDocument(); 3.Get inbound URI element values from document &oprid = &oprDoc.GetElement("oprid").value; 4.If POST then get content body &str = &_MSG.GetContentString();

37 Page 37 5) Create Handler 5.Create return message &returnMsg = CreateMessage(Operation.OPERATOR_GET, %IntBroker_Response); 6.Populate return message &returnDoc = &returnMsg.GetDocument(); &returnCom = &returnDoc.DocumentElement; &returnCom.GetPropertyByName("oprid").value = &oprid; &returnCom.GetPropertyByName("oprdefndesc").value = &descr;

38 Page 38 5) Use Document Tester to get PeopleCode for Handler class

39 Page 39 6) Create Service Operation

40 Page 40 6) Resource Definition

41 Page 41 REST URI – Resource Document http://myserver/operators/oprid=VP1 /operators/oprid={oprid} Template Mapping by element name

42 Page 42 6) Resource Template Builder

43 Page 43 6) Response Definition

44 Page 44 6) Service Operation Security

45 Page 45 6) Assign Handler to Service Op

46 Page 46 7) Test Handler

47 Page 47 7) Test Handler

48 Page 48 8) Create Routing Local-to-Local needed to use Service Operation Test utility. Any-to-Local needed to test service outside PeopleSoft.

49 Page 49 9) Test Service Operation

50 Page 50 10) Publish Web Service Integration Broker > Web Services > Provide Web Services Only need to publish if you need the WADL document.

51 Page 51 Test Web Service SOAPui friom SmartBear www.soapui.org PeopleTools SendMaster %PS_HOME%\sendmaster Any Browser (to test GET ) Fiddler (to test GET/POST/PUT/DELETE )

52 Page 52 REST Security PeopleTools supports no authentication (ie public) BASIC Authorization with or without SSL Adds HTTP header to Request Authorization: BASIC Base64

53 Page 53 Demonstration of REST Jim Marion Principal Applications Technology Consultant, Oracle Author of two fine books on PeopleTools Jims Journal @ http://jjmpsj.blogspot.co.uk/http://jjmpsj.blogspot.co.uk/

54 Page 54 Any questions Graham Smith PeopleSoft Technical Team Leader Oxfam GB gsmith@oxfam.org.uk i-like-trains.blogspot.com


Download ppt "CON7553 PeopleTools REST Web Services: Everything You Need to Know Graham Smith - OXFAM GB PeopleSoft Technical Lead & System Architect."

Similar presentations


Ads by Google