RESTful web services in PeopleSoft

For a long time, integration of Peoplesoft with external applications was done only by using XML as means of communication. While new programming languages and frameworks in the market have started to widely adopt REST web services and handle JSON, it was only about time Peoplesoft also followed suit. You can enable REST services in Peoplesoft if your tools version is PT8.53 or above.

Peoplesoft still supports XML exchanges and SOAP calls, and REST is a valuable addition to its integration capabilities. Traditionally, Peoplecode only had the ability to comprehend XML, and now even JSON can be handled with ease.

This article explains how a simple REST Web service can be created in PeopleSoft that will take an input parameter and produce an output which can be integrated with third party applications.

Below are the steps involved in creating input and output messages for the REST Web Service in PeopleSoft:

Step 1: Define documents

Step 2: Define messages

Step 3: Create service

  • Define security
  • Set request parameters
  • Set response parameters

Step 4: Create a handler

  • Write handler code

Step 5: Provide the REST service

 

Define documents

Navigate to PeopleTools > Documents > Documents Builder

  • Create a document with parameters which acts as a request, set the root element to request, and create a primitive with a predetermined length
  • Create a second document with the parameters, this will be the response and add primitives of proper type and length for this document.

On JSON tab set the JSON label also to request

Define Messages

Navigate to PeopleTools > Integration Broker > Integration Setup > Messages. Create two messages one for the request and one for the response and these must be mapped to the documents predefined in the previous step.

Create a Service

Navigate to PeopleTools > Integration Broker > Integration Setup > Services

Create a new web service and check the ‘Is Provider’ checkbox.

Save the service and add a new service operation with GET as REST Method

 

After creating this, we need to take care of the following:

  • Define security

Assign a permission list to the service operation via Service Operation Security. The user that calls the service must have this permission list assigned via a role.

  • Set request parameters

In the URI scroll fill in, use a template which will pre populate the REST base URL which is the combination of the base URL and the template.

  • Set response parameters

For this setup use the created response message in step 2 and set content-type to application/json to return as a response.

 

Create a handler

On the “Handlers” tab of the service operation, link an application class, which handles the requests and returns a response.

Provide the REST service

Navigate to PeopleTools > Integration Broker > Web Service > Provide Web Service and publish the REST web service using the wizard. This will provide a WADL (Web Application Description Language) which we can provide to third parties so they can integrate.

If you are considering integration in Peoplesoft using REST, contact us.

Leave a Reply

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.