Showing posts with label web services. Show all posts
Showing posts with label web services. Show all posts

Quick Introduction to PeopleSoft Web Services

Introduction 

Web Services are getting popular day by day and as developers we are constantly getting requirements to intergrate our PeopleSoft application with thrid-party system to interchange data between systems. In fact PeopleSoft system delivers web services so that we can leverage those web services, extend or create our own web services esaily within our PeopleSoft system. Some examples of PeopleSoft delivered web services are (in Campus Solutions) , List of Values WS, AAWS (Admission Applications Web Services). In addition to the conventional SOAP based web services PeopleSoft now facilitate to develop RESTful web services using PeopleSoft Intergreation Broker.

Web Service Overview

A web service provides external applications a web-services-based means of accessing PeopleSoft data. Web services are implemented through the PeopleTools Integration Broker (IB) framework. The Integration Gateway web application receives all the web service requests and forwards them to the Integration Engine (application server) for processing.

Following process occurs when you use web service with a client application

1. The client application invokes one of the service operations from the API (application programming interface) published by PeopleSoft application.

For example in in Campus Solutions, Admission Applications Web Service contains the following web service operations
  • SAD_ADMISSIONS – Main Admissions Web Service
    • SAD_CREATEAPPL: Create Application
    • SAD_GETAPPL: Find Application
    • SAD_GETAPPLS: Find Applications
    • SAD_SAVEAPPL: Save Application (for later modification or submission)
    • SAD_SUBMITAPPL: Submit Application
    • SAD_GETATTACH: Get Attachment
The service operation SAD_CREATEAPPL is shown below;

2. PeopleSoft Integration Broker receives the service operation request and validates the WS security credentials.

Web services security (WS-Security) is implemented on the integration gateway for inbound and outbound integrations with third-party systems. WS-Security adds a layer of security to sending and receiving service operations by adding a UsernameToken that identifies the sender and authenticates its identity to the web service provider. On inbound processing, PeopleSoft Integration Broker can process requests received from integration partners that contain WS-Security UsernameToken and passwords in the SOAP (Simple Object Access Protocol ) header of the inbound SOAP request. The user name and password should be encrypted via PKI (public key infrastructure).

Some web service operations require a user ID and password. If a user ID and password are not supplied in the SOAP header, Integration Broker rejects the request.
If the request is received from another PeopleSoft system, the user ID associated with the requesting PeopleSoft node is used when the SOAP header does not specify a user name.
When a request is received, PeopleSoft Integration Broker validates the user ID and password in the SOAP header to determine whether the user has the proper security to invoke the service operation requested.

Generally you implement WS security in PeopleSoft via Permission Lists.
in the above screen shot the permission list HCSPSERVICE gives full access to the individual service operations in the SAD_ADMISSIONS WS.
Depending on the requirements, in the service operation level you can specify authentication mechanism so that users who has proper privileges can access to your service operations.

3. The request is passed to Application Server for processing. The Application Server authenticates the service operation and routes it to the respective handler. The handler executes the PeopleCode and sends the response to Integration Gateway.

Handler is basically a application class which has your PeopleCode logic (or business logic) to execute when the service operation is called. handlers can be define in the Handler section in the service operation as follows;

4. Integration Broker sends the response to the client application.

Client application who invoke WS will get XML response message (SOAP based WS). Sometimes client application may get error response messages so that clients can correct and resubmit the WS.
Client application then process this XML response message and present in their Front-end application in a suitable format.

How to Test Delivered PeopleSoft Web Service using SoapUI

Prerequisites

Download SoapUI from http://www.soapui.org/
SoapUI is an open-source web service testing application for service-oriented architectures (SOA) and representational state transfers (REST).
It's simplicity and easy to use interface allows developers and testers to quickly test PeopleSoft web services without spending too much time of learning about SoapUI.
In this example we are going to look at a delivered web service called List of Values (LOV) web service in PeopleSoft Campus Solutions (CS).

A quick overview of the List of Values Web Service

Suppose you have an online application that presents list of prompt fields to the users.
The list of values retrieved by the service is used to populate drop-down list boxes or prompt fields in an external UI.
The List of Values web service (service operation SCC_GET_LOV) allows an external UI to request a list of prompt or translate values for a field name configured inside the PeopleSoft Campus Solutions database.
Also, the external UI logic can use this retrieved list of values to validate a value that a user enters in a field of the external UI.
As an example assume that you pass valid translate values for possible Phone types for the external UI to display in a Phone Type drop down list so that a valid value can be picked by a user.

The LOV request message (SCC_LOV_REQ message) accepts the following input parameters:
Record Name (required).
Field Name (required).
LOV Context (optional – defined on the List of Values Setup component).

The Get List of Values service operation (SCC_GET_LOV) is called, the external UI nominates the field name and its record for which the service should return the list of values.

So, in this example we will try to get valid phone types from the translate values from PERSONAL_PHONE and the field name PHONE_TYPE (and LOV Context is left blank purposely).

Provide the web service

To provide the web service navigate to PeopleTools > Integration Broker > Web Services > Provide Web Service

In order to generate WSDL (web service description language) for your service, you need to use the Provide Web Service wizard to generate the web service in PeopleSoft.
The service for the List of Values web service is SCC_LOV and the service operation is SCC_GET_LOV.

Step 1

Search for the service SCC_LOV. Select your service and press Next.

Step 2

SCC_LOV service has SCC_GET_LOV service operation. Note that SCC_GET_LOV service operations will have request, response and fault messages associate with it.


Step 3

A WSDL file will be generate for SCC_LOV service. You can view it during this step.


Step 4

The final step is the wizard publishes the WSDL for your web service to the PeopleSoft WSDL reposit


Step 5

The last page will show the confirmation of your results of creating and publishing the WSDL for your web service.
Note down the Generated WSDL URL which will required when you want to create the SOAPUI project.


Create a new SOAP project

Assuming you have already downloaded SoapUI, then Open up your SoapUI instance.
In SoapUI, choose File > New SOAP Project (CTRL + N). Specify the project name, then enter the URL (from step 5) to the WSDL for your web service.


If the project is successfully created then in the left Navigator pane you can see your project and the SOAP Request.


Testing the Web Service

Double-click on the generated request (Request1) and that will open a new request window with a SOAP envelope.
In the generated XML replace the question mark (?) between the ser:FIELDNAME tag and ser:RECORDNAME tag with PHONE_TYPE field and PERSONAL_PHONE record.


For this exercise I'm going to remove Optional sections from the XML as they need to configure for different purposes.
Now my XML request looks like this.


Once you submit this request your response will look like this. Note that all the active Phone Types (Translate values) will be displayed as a CODE/VALUE pair in the response.


Conclusion

In this post we looked at how to quickly test a delivered PeopleSoft web service, List of Values (SCC_LOV) using SoapUI.
List of Values web service is related to PeopleSoft Campus Solutions and this comes handy if someone new to PeopleSoft web service to get a basic idea of how to test a web service.

feel free to send any comments or suggestion!

How to deliver RESTful Web Services in PeopleSoft - Useful Resources

How to deliver RESTful Web Services in PeopleSoft - Useful Resources
Quick Overview of RESTful Web Services
Representational State Transfer (REST) describes any simple interface that transmits data over a standardized interface (such as HTTP) without an additional messaging layer, such as SOAP. REST provides a set of design rules for creating stateless services that are viewed as resources, or sources of specific information, and can be identified by their unique URIs. A client accesses the resource using the URI, a standardized fixed set of methods, and a representation of the resource is returned. The client is said to transfer state with each new resource representation.
When using the HTTP protocol to access RESTful resources, the resource identifier is the URL of the resource and the standard operation to be performed on that resource is one of the HTTP methods: GET, PUT, DELETE, POST, or HEAD.
Some Useful reference to resources that can be used to get an understanding of REST based web services in PeopleSoft.
OOW_REST.zip is the AppDesigner project used in the CON7553_Smith-CON7553 REST Web Services in PeopleSoft_v3.
OOW_REST.zip

How to Test Web Services within PeopleSoft Campus Solutions without SOAPUI

If you are in PeopleSoft Campus Solutions Navigate to;
Set Up SACR > System Administration > Generic Service Tester > Service Tester
Add Service Tester ID from Prompt (Say for example delivered List of Values web service SCC_GET_LOV)
 
Add Sign on (WS security) – you must configure security access to the web service you are invoking.
Once done you can create request and submit the request as follows;