Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Oxfam
Oxfam is a vibrant global
movement of dedicated
people fighting poverty
70 years experience in 94 countries
Syria - Helping over 200,000 refugees
Page 2
PeopleSoft @ OXFAM
HCM & FSCM Applications
4,500+ users in 70+ countries
Working on 9.2 upgrade to FSCM
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
Page 5
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
Page 7
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)
Page 8
What is REST?
REST REpresentational State Transfer
Page 9
Page 10
Page 12
Page 13
Page 14
An error may
occur in the
Handler code if
Earlier than
8.53.06
Page 15
PT_LOOKUPXLAT_REST_GET
http://server/PSIGW/RESTListeningConnector/PTLOOKUPXLAT_R
EST.v1/XLAT_Lookup/RUNSTATUS?fieldVal=7
Page 16
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
Page 17
http://myserver/operators
oprid
oprid
oprid
oprid
oprid
oprid
oprid
oprid
oprid
oprid
oprid
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxx
http://myserver/opeators/oprid=VP1
VP1 xxxxxxxxxxxxxx
Page 18
Resource name
http://myserver/operator/oprid=VP1
Resource name
RESOURCE TEMPLATES
Page 19
Page 20
Create Document
Test Document
Create Message
Create Service
Create Handler
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.
Page 21
Service Operation
Resource Definition
URI Definition
Template(s)
Resource
Document
Template
URI
Template(s)
Response
Message
(20
Document
Template
Fault Message
(400)
Response
Message
(200)
Fault Message (400)
Resource
Document
Message
Response
Document
Handler (OnRequest)
Handler (OnRequest)
Page 22
http://myserver/operator/vp1
1) Documents Definition
Define hierarchical data structures (logical)
Map onto physical structures
XML
JSON
Database records and fields
Page 24
Page 25
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
1) Create Document
Page 27
Page 28
2) Document Tester
Page 29
Page 30
Page 31
Page 32
Page 33
3) Create Message
The DOCUMENT is not enough. A message of type Document must be created.
Page 34
4) Create Service
Page 35
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();
Page 36
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;
Page 37
Page 38
Page 39
6) Resource Definition
Page 40
Page 41
Page 42
6) Response Definition
Page 43
Page 44
Page 45
7) Test Handler
Page 46
7) Test Handler
Page 47
8) Create Routing
Page 48
Page 49
Page 50
PeopleTools SendMaster
%PS_HOME%\sendmaster
Page 51
REST Security
PeopleTools supports no authentication (ie public)
BASIC Authorization with or without SSL
Adds HTTP header to Request
Authorization: BASIC <oprid:password>
Page 52
Base64
Demonstration of REST
Jim Marion
Principal Applications Technology Consultant, Oracle
Author of two fine books on PeopleTools
Jims Journal @ http://jjmpsj.blogspot.co.uk/
Page 53
Any questions
Graham Smith
PeopleSoft Technical Team Leader
Oxfam GB
gsmith@oxfam.org.uk
i-like-trains.blogspot.com
Page 54