Author Info
Chris Malek

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

About Chris Work with Chris
Looking for pain-free PeopleSoft web services? 😀
PeopleSoft Simple Web Services (SWS)

Introducing a small but powerful PeopleSoft bolt-on that makes web services very easy. If you have a SQL statement, you can turn that into a web service in PeopleSoft in a few minutes.

Contents

OnRequestSend Handlers

The OnRequestSend handler can be used in Synchronous and Asynchronous service outbound operations. It allows you to manipulate the message content before it get to the subscribing node and before any transformations happen. You can use this to customize the message or the connector properties specific to a node.

From PeopleBooks:

Any content data that is changed on the message or XMLDoc is sent to the subscribing node or used within a transformation.

  • Types of Service Operations: Synchronous and Asynchronous
  • Direction Used: Outbound Service Operations
  • Inputs: Message Object of outbound request
  • Outputs: Manipulated message object to be sent to subscribing node.
import PS_PT:Integration:ISend;

class syncOnRequestSendHandler implements PS_PT:Integration:ISend
   method OnRequestSend(&Msg As Message) Returns Message;
end-class;

method OnRequestSend
   /+ &Msg as Message +/
   /+ Returns Message +/
   /+ Extends/implements PS_PT:Integration:ISend.OnRequestSend +/
   
   &Msg.IBInfo.ConnectorOverride = True;
   Local File &f;
   &f = GetFile("D:\psft\OnRequestSend.log", "W", %FilePath_Absolute);
   Local XmlDoc &xmldocRequest;
   &xmldocRequest = &Msg.GetXmlDoc();
   
   Local XmlNode &childNode;
   &childNode = &xmldocRequest.DocumentElement.AddElement("OnRequestSend").AddText("I modified the message");
   &f.WriteLine("time" | %Datetime);
   &f.WriteLine(&xmldocRequest.GenXmlString());
   &f.Close();
   &Msg.SetXmlDoc(&xmldocRequest);
   
   Return &Msg;
   
end-method;