Contents
Contents

Add MetaData in all Responses

Struggling to bridge the legacy gap? Cedar Hills Group provides specialized PeopleSoft integration consulting to help teams design, build, and optimize their connection strategies.

This section discusses a subtle practice that can add immense value for production support and debugging. It adds a metadata node to return data about the context of the request.

Let’s imagine that you have a simple request/reply asynchronous service operation.

  • It takes in EMPLID as a parameter
  • It returns the name associated with the EMPLID.
  • This service is XML based but this can easily be ported over to JSON.

The important part I want to highlight here is the meta element where we return:

  • dbname - The name of the database this ran in.
  • toolsVer - The tools version that this ran in.
  • psftTransactionId - The PeopleTools Integration Broker GUID that can be used to lookup the request in the IB monitoring tables.
  • currentUser - The OPRID running the PeopleCode.
  • responseDTTM - The date-time this was run
  • dbType - The database type.
  • request* - A singular node or nested node that contains the request parameters. This may not be feasible for large payloads.
  • serverTimeZone - The time zone of the server.

I have code running at different clients. When one of them experiences an issue all that information can be extremely useful and expedite troubleshooting. I often get a pasted response or screenshot of the PeopleSoft output from a user mentioning an issue. When these metadata elements are present, I have found it can answer many up front questions that may not have been provided. A user may just say “the web service is not working” and send a screenshot of the response. This response metadata can quickly provide that information up front without any back and forth. Perhaps the person has the wrong URL and is connecting to the wrong system. If you have the database name and the user they are authenticating as you can rule that out straight away. Additionally, if you echo back the request parameters typos and other simple but inevitable errors are quickly spotted.

Here is the HTTP signature of the request.

GET http://test.psft.cedarhillsgroup.com/PSIGW/RESTListeningConnector/PSFT_CS/CHG_PERSON.v1/SF0001 HTTP/1.1
Authorization: Basic .....

Here is a sample response. Take a look at lines 13 to 21.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
HTTP/1.1 200 OK
Connection: close
Date: Sun, 23 Aug 2020 16:08:28 GMT
Content-Length: 234
Content-Type: text/xml; encoding="UTF-8"
Content-Encoding: gzip
Set-Cookie: JSESSIONID=FrMcFAah28q8ngzYwYGMVGkjSdftPjc54scmjEJQzTeHBPvBimGu!-605235278; path=/; HttpOnly,psmap=; domain=.c.peoplesoftdemo-1470578694381.internal; path=/

<?xml version="1.0"?>
<response>
  <emplid>SF0001</emplid>
  <name>Sandra Epstein</name>
  <meta>
    <dbname>CS92U009</dbname>
    <toolsVer>8.56</toolsVer>
    <psftTransactionId>7fa9758b-e55d-11ea-a58d-c780246cd91c</psftTransactionId>
    <currentUser>PS</currentUser>
    <responseDTTM>Sun, 23 Aug 2020 23:27:13 GMT</responseDTTM>
    <dbType>ORACLE</dbType>
    <requestEmplid>SF0001</requestEmplid>
    <serverTimeZone>PST</serverTimeZone>
  </meta>
</response>

Here is a basic handler to output the meta-data.

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

   Local Message &response;

   Local Document &reqDOC = &msgRequest.GetURIDocument();
   Local string &EMPLIDParameter = &reqDOC.GetElement("EMPLID").value;

   &response = CreateMessage(@("Operation." | &msgRequest.OperationName), %IntBroker_Response);

   Local XmlDoc &xmlout;
   Local XmlNode &childNode;

   &xmlout = CreateXmlDoc("<?xml version='1.0'?><response/>");

   &childNode = &xmlout.DocumentElement.AddElement("emplid").AddText(&EMPLIDParameter);

   Local Record &recName = CreateRecord(Record.PERSON_NAME);
   &recName.EMPLID.Value = &EMPLIDParameter;
   &recName.SelectByKey();

   &childNode = &xmlout.DocumentElement.AddElement("name").AddText(&recName.NAME_DISPLAY.Value);

   Local XmlNode &metaNode;
   &metaNode = &xmlout.DocumentElement.AddElement("meta");

   &childNode = &metaNode.AddElement("dbname").AddText(%DbName);
   &childNode = &metaNode.AddElement("toolsVer").AddText(%ToolsRelease);
   &childNode = &metaNode.AddElement("psftTransactionId").AddText(&msgRequest.IBInfo.TransactionID);
   &childNode = &metaNode.AddElement("currentUser").AddText(%OperatorId);
   &childNode = &metaNode.AddElement("responseDTTM").AddText(DateTimeToHTTP(%Datetime));
   &childNode = &metaNode.AddElement("dbType").AddText(%DbType);
   childNode = &metaNode.AddElement("serverTimeZone").AddText(%serverTimeZone);
   /* echo out inbound parameters for debugging - of time errors are from invalid input */
   &childNode = &metaNode.AddElement("requestEmplid").AddText(&EMPLIDParameter);

   &response.SetXmlDoc(&xmlout);

   Return &response;

end-method;

If you spend a few extra minutes adding this or creating an application class to append this information to all responses you will benefit from it.

Author Profile
Chris Malek

Chris Malek is a PeopleTools® Technical Consultant with over two decades of experience. He is available for consulting engagements.

Work with Chris
Subscribe to Updates
SWS Bolt-On
PeopleSoft Simple Web Services

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
Read More & Purchase
SWS Bolt-On
PeopleSoft Simple Web Services

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
Read More & Purchase
SWS Bolt-On
PeopleSoft Simple Web Services

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
Read More & Purchase
SWS Bolt-On
PeopleSoft Simple Web Services

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
Read More & Purchase
psLens Platform
psLens Operations & Intelligence

Look up any record, field, page, or component, audit security, and monitor Integration Broker across every database — in seconds.

  • 30+ object types browsable
  • 16 real-time alert types
  • Read-only by design
  • No App Designer or SQL required
Learn More
psLens Platform
psLens Operations & Intelligence

A web console built for the PeopleSoft community — operational monitoring, security auditing, and metadata browsing in one tool.

  • Sub-second object search
  • Catch stuck IB messages before users do
  • Audit service permissions from one screen
  • Works in any browser
Learn More
psLens Platform
psLens Operations & Intelligence

On-demand security and operational reports for your PeopleSoft environment — no client install required.

  • 14 on-demand reports
  • Markdown export for AI/LLM workflows
  • No shared tenancy
  • Built on 25+ years of PeopleSoft expertise
Learn More
psLens Platform
psLens Operations & Intelligence

Research any PeopleSoft object and monitor system health from a single browser tab — no App Designer, no SQL.

  • 30+ PeopleSoft object types browsable
  • Real-time alerts before users report problems
  • Read-only and secure
  • Private alpha — early access now
Learn More