Exposing an Application with a Service – Pega 8

In this Quick tutorial you will learn about How to Exposing an application with a service in Pega 8

Exposing an Application as a Service:

The two most common ways to expose your application as a service.

  1. Create a web service
  2. Leverage the Pega API

Note: These two options work the same way: a request is made to the URL, and a response is returned. The difference is how you communicate with the service.

Leverage the Pega API:
  • The Pega API provides a standard set of services that includes new case creation, assignment processing, and access to data pages.
  • These built-in REST/JSON services enable the rapid implementation of Pega-powered mobile and client applications.

Click the Resources menu and select Pega API to see the details of the request and response data requirement.

pega api resources menu

pega api updates resouces landing page

This documentation is also available in JSON format in the Docs API (GET/docs).

Create a SOAP service:
  • SOAP web services communicate using the SOAP protocol and pass XML messages from one application to another.
  • Your application needs to convert that XML message to Pega objects to process them and convert those Pega objects back to XML after the processing is complete.

pega soap service

A SOAP service uses a combination of rules to process a request. 

  • Service activity : It provides the processing for a service rule
  • XML Parser : It Maps data from an XML message into clipboard property values.
  • XML Stream : It Assembles and sends an XML document in an email message, a SOAP message, a file, or other types of messages.
  • Service Package : It Groups one or more service rules that are designed to be developed, tested, and deployed together.

The following diagram shows how Pega processes a service request.

 

service processing model pega 8

Service Wizard:
  • In Dev Studio, Select Configure > Integration > Services > Service Wizard
  • Set the Service Purpose to Create and manage work, Set the Service Type to SOAP and click Next.

SOAP service wizard pega

  • Set Work Type (Case) and set Flow Type to pyStartCase
  • Select Create Work and set the Organization and click next.

service wizard service details pega 8

  • Select Use XML for data mapping to allow for list structures in the reqeust.

xml service data mapping pega 8

  • Set the Ruleset Name and Ruleset Version to the version in which you are working.
  • From the Service Package Options drop-down list, select Configure a new service package, then click Next.

select service ruleset and version in pega 8

  • Keep the default settings in the Configuration Data Records screen. Click Next.

Note: Requires authentication is selected by default. This means that you need to provide an operator and password when you call your service.

  • The Review and Save screen displays the records that will be created by the wizard. Click Finish to create the records.

service wizard final screen pega 8

Add inherited properties:
  • Open the CreateNewWorkResponse XML parse rule generated by the Wizard
  • Click Add Element to add the required input parameter that was not available for selection in the Wizard.

service add element rule pega 8

  • Double-click the new property to configure it.
  • Enter a Node Name specify the Property to map the value.
Test the service:
  • Open the service rule.
  • Click Actions > Run to test the service rule.
  • Select Supply SOAP request envelope to enter values for the test.
  • Click Execute to test the service.
  • Your response will vary based on what you are attempting to do. If there is an error, you see a SOAPFault exception produced.

Leave a Reply

Your email address will not be published. Required fields are marked *