Contents

OnRequest Handler

  • Description - This handler is used to process a synchronous request. This the type of handler you will most often implement for a web service to a third party. It takes the request, parses it, does something and returns a response.

  • Inputs - Message Object sent by the client.

  • Outputs - Message object to be returned to the client as the response.

  • Application Class Interface

    • PS_PT:Integration:IRequestHandler

Template OnRequestCode

Below is a template code that can get you started with an OnRequest handler. The onRequestTemplateHandler class name needs to be changed. This example pulls in the inbound XML document but does not actually do anything with it. It also returns a hard coded response.

import PS_PT:Integration:IRequestHandler;

class onRequestTemplateHandler implements PS_PT:Integration:IRequestHandler
   method onRequest(&MSG As Message) Returns Message;
end-class;

method onRequest
   /+ &MSG as Message +/
   /+ Returns Message +/
   /+ Extends/implements PS_PT:Integration:IRequestHandler.OnRequest +/


   Local XmlDoc &xmlDocInBound;

   Local XmlNode &requestRootNode;
   &xmlDocInBound = &MSG.GetXmlDoc();

   &requestRootNode = &xmlDocInBound.DocumentElement;


   /* Setup response xml body */

   Local Message &response;
   &response = CreateMessage(&msg.OperationName, %IntBroker_Response);
   Local XmlDoc &xmlout;
   &xmlout = CreateXmlDoc("<?xml version='1.0'?><response/>");

   Local XmlNode &childNode;

   &childNode = &xmlout.DocumentElement.AddElement("helloworld").AddText("greetings");

   &response.SetXmlDoc(&xmlout);

   Return &response;

end-method;

Parking Lot

/* This interface is the equivalent of the OnRequest PeopleCode event 
in 8.4x tools. OnRequest will pass in a message to your derived 
application class method. The return needs to be a message. 

If an error occurs the OnError method if implemented will be 
automatically invoked. The type of exception can be viewed by using the 
Message object to retrieve the Exception object (&Message.IBException).
Please see the PeopleCode Language Reference guide for 
more information about the Exception class. 

OnError:
The return string of this method is used for a custom error 
message back to the Sender (if its not PeopleSoft). If the request was via SOAP
then the string will be wrapped in a SOAP FAULT and returned. If the string itself is
SOAP then it will not be wrappered but sent back as is.

Note that the return string is optional, in that if the string is null then the 
Integration Broker runtime will handle the error.

(REST based Service Only)
The Response Code will be automatically set based
on the value defined for the Fault Message on the Service Operation Defintion.
*/

interface IRequestHandler
   method OnRequest(&message As Message) Returns Message;
   method OnError(&request As Message) Returns string;
end-interface;

Author Info
Chris Malek

Chris Malek is a PeopleTools® Technical Consultant with over two decades of experience working on PeopleSoft enterprise software projects. He is available for consulting engagements.

Work with Chris
PeopleSoft REST APIs in Minutes, Not Months
PeopleSoft Simple Web Services (SWS)

SWS turns SQL into production REST APIs — ready for AI, modern apps, and partner integrations. One install, unlimited potential.

  • Configuration-driven, no coding required
  • JSON, XML, and CSV output
  • Works across all PeopleSoft pillars
  • Built on 25+ years of PeopleSoft expertise
Looking for pain-free PeopleSoft web services?
PeopleSoft Simple Web Services (SWS)

A powerful PeopleSoft bolt-on that makes REST web services easy. You bring the SQL, SWS handles the rest.

  • Go from idea to production in minutes
  • Zero code migrations after install
  • JSON, XML, and CSV output supported
  • No PeopleCode or Integration Broker expertise required
Stop Building PeopleSoft Web Services the Hard Way
PeopleSoft Simple Web Services (SWS)

Traditional PeopleSoft web services cost $3,600–$13,000 each to develop. SWS deploys production REST APIs in under 5 minutes through configuration alone.

  • No PeopleCode or Integration Broker expertise required
  • Works across Campus Solutions, HCM, and Financials
  • Built-in pagination, caching, and nested data structures
  • Trusted by institutions across higher education and government
PeopleSoft REST APIs for AI, Modern Apps, and Integrations
PeopleSoft Simple Web Services (SWS)

Turn PeopleSoft data into clean REST APIs for AI integrations, modern applications, and vendor data feeds. Configuration-driven — no PeopleCode required.

  • Deploy production APIs in under 5 minutes
  • AI and LLM ready (RAG, chatbots, intelligent search)
  • JSON, XML, and CSV output
  • Zero modifications to delivered PeopleSoft objects