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 ChrisIntroducing 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.
First we will look at a simple REST JSON Post. The screenshot below has the service operation setup. This is the most simple web service. You will notice that:
Template
other than /
Document Template
because we are not passing any parametersCHG_GENERIC.V1
which is a “Nonrowset-based” based messages. This is is not shown.We plan on posting some simple JSON to this. The HTTP Signature will look like this:
POST http://localhost:8000/PSIGW/RESTListeningConnector/PSFT_CS/CHG_JSON_TEST.v1/
Authorization: Basic UFM6dHJ5aW5nLXNlZS1pZi1JLXBvc3RlZC1teS1wYXNzd29yZC1JLXNlZQ==
Content-Type: application/json
{
"firstName": "Chris",
"lastName": "Malek",
"Region": "Southern California",
"FavoriteDesert": "Pie, any kind"
}
The response that comes out of this web services the following.
HTTP/1.1 200 OK
Connection: close
Date: Wed, 02 Dec 2020 04:33:21 GMT
Content-Length: 234
Content-Type: application/json; encoding="UTF-8"
Content-Encoding: gzip
Set-Cookie: JSESSIONID=6zshuetDLvmVT5G55VCUt0su3nVWAn469hsagTQOqg0zHVExziNa!-1985259815; path=/; HttpOnly,psmap=; domain=.c.peoplesoftdemo-1470578694381.internal; path=/
{
"firstName": "Chris",
"lastName": "Malek",
"Region": "Southern California",
"FavoriteDesert": "Pie, any kind",
"META": {
"OPRID": "PS",
"CURRENT_TIME": "2020-12-02 04:33:21.000000",
"TRANSACTION_ID": "81fa5f4b-3457-11eb-9b6b-e783fa52141b",
"DBNAME": "CS92U009"
}
}
The handler parses the inbound root JSON object strings and echos any value back out. We also add a “META” object with some information about the run-time environment.
The entire PeopleCode handler for this web service is:
|
|
With this simple example you can see:
This web service has no:
For now see JSON Parsing Using PeopleTools JsonParser