Saturday, 21 May 2016

Ways to access PeopleSoft RESTful Web Services

Well, People soft allows RESTful web services fully starting 8.53. I will post steps to create web services in my next blogs. Today we will see the ways to access Restful web services.

1. SOAP tester Tool
2. Advance REST client
3. CURL command 

Lets focus on CURL command which allows accessing web services from command prompt.

1. Download the CURL.exe from below site(download based on your OS) and place in one working directory.   https://curl.haxx.se/download.html

2. After creating Service Operation, You can get a uri(unique resource identifier) which looks like below.

http://<hostname>:<portname>/PSIGW/RESTListeningConnector/<node>/<service operation>/employee/{EmployeeID}/profile

3. In case you want to add custom header to your request, use -H to add the heaer value.

Curl Command for GET verb with Header: 

curl -i -H "Content-Type: application/json" -X GET http://<hostname>:portname>/PSIGW/RESTListeningConnector/<node>/<serviceoperation>/employee/{EmployeeID}/profile

Curl command for POST verb with header:

curl -i -H "Content-Type: application/json" -X POST -d "{\"myRequestID\": 0,\"myPayType\": \"XXX\",\"myPaySubType\": \"YYY\"}" http://<hostname>:portname>/PSIGW/RESTListeningConnector/<node>/<serviceoperation>/employee/{EmployeeID}/payPost

4. Go to Command prompt, Navigate to the folder where curl.exe is placed. Paste this command and fire. You will get the response with http status code.

This was you can access your webs services if autorization token is not enabled in service operations. If enabled, you need to pass the authorization token in header parameter.

Hope this helps!

Thanks,
Manoranjan

1 comment: