This section is going to cover some code samples related to REST handlers.
There are time where you may need to create a Service Operation Handler that serves both REST and HTTP services. Most of the code in the handler might be the same between those two. The real difference is generally how you detect parameters. This can be useful when you do not want to duplicate code and you need to serve legacy and new clients. This section will not pertain to all readers in practice.
First let’s take a look at how we can determine at run-time if the service is running under a REST web service setup.
URIResourceIndex property on the Request message object. If it is greater than 0 then you are running under REST.
|
|
There are a few ways to structure your REST Services when you have multiple Methods:
You can:
When you have a single handler processing different HTTP Methods you are going to need to detect the HTTP Method at run-time and take the appropriate action. Here is a code sample that shows how to detect the HTTP Method.
|
|
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 ChrisSWS turns SQL into production REST APIs — ready for AI, modern apps, and partner integrations. One install, unlimited potential.
A powerful PeopleSoft bolt-on that makes REST web services easy. You bring the SQL, SWS handles the rest.
Traditional PeopleSoft web services cost $3,600–$13,000 each to develop. SWS deploys production REST APIs in under 5 minutes through configuration alone.
Turn PeopleSoft data into clean REST APIs for AI integrations, modern applications, and vendor data feeds. Configuration-driven — no PeopleCode required.