PeopleTools REST Web Services Part 1I recently presented at Oracle OpenWorld on the subject of REST web services in PeopleSoft. REST based web services were introduced in PeopleTools 8.52 and I'm hoping this series of blog posts will help newcomers to both Web Services and REST.
What is REST?REpresentational State Transfer (REST) is a style of doing Web services that is becoming increasingly popular among web developers due to it's simplicity over SOAP and other methods.
REST follows 4 basic principles
1) All content has a unique id by which it is referenced (URI)
2) services are invoked using standard WWW operations of GET, POST, PUT, DELETE
3) all REST services are stateless in that they retrieve a representation (copy) of the content requested
4) REST is synchronous only. Designed for point to point communication
You can invoke a REST web service simply by using it's URI. For example an example REST web service to GET PeopleSoft operator details might look like this.
DocumentsUnderstanding the PeopleTools Document object is necessary to building REST based web services in PeopleSoft so let's cover some of the basics.
What is a Document?Documents represent a hierarchical data structure a lot like a Rowset object. They have a logical representation and a physical representation in the form of XML, HTML and JSON (from Tools 8.53).
Documents can be grouped together in a Package and like other Integration Broker object definitions can be versioned.
Document Data TypesA document is a tree structure representing data. As such, every document has ROOT element that is the name of the Document.
There a four basic data types
*Primitive. An element that has one of the simple data types of integer, string, character, date, time, etc.
*Compound. An element that contains 1 or more primitives (think Record definition)
*Complex Primitive Compound. A primitive element that has attributes. (think XML attributes
*Collection. An element that is a repeating group of Compound and/or Primitives. (think Rowsets)
What Role do Documents play in REST Web Services?A Document is required to collect the inbound URI parameters from a REST web service call. This is done by mapping the URI parameters to document element names. This is called the Document Template.
The next post will show how to create Service, Service Operations and Handlers.
All the code used in this series on REST can be downloaded from here http://goo.gl/KUX9F2