Skip to main content
close Search
Close search

Challenge

Creating a SOAP connector

4 Tasks

30 mins

Visible to all users
Beginner Pega Platform 8.2 English

Scenario

Human Resources (HR) business partners use a legacy application to locate discount services available to employees near their home location. This application requires a longitude and latitude value to locate the discount services. To help facilitate the use of this legacy application, HR business partners have asked to extend the HR Apps application functionality to identify the latitude and longitude for a given zip code.

The following table provides the credentials you need to complete the exercise.

Role Operator ID Password
Senior System Architect SSA@TGB rules

Your assignment

Create a SOAP Integration rule and configure a data page to invoke the SOAP connector

  • Create a SOAP integration rule to connect to a zip code look up service.
  • Create an XML parse rule to extract the latitude and longitude values from the SOAP connecter response.
  • Create and configure a data page to invoke the SOAP connector.
  • Optional: Create and configure the Location look up case type to invoke the data page.

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Create a SOAP Integration rule to connect to a zip code look up service

  1. In Dev Studio, select Configure > Integration > Connectors > Create SOAP Integration to open the create a new SOAP Integration form.

  2. On the New SOAP Integration page, in the Load WSDL step, select Upload WSDL from URL to enable the option to connect to a URL.
  3. In the Upload WSDL from URL field, enter https://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl.

  4. In the lower-right corner of the New SOAP Integration page, click Next > to proceed to the Select Operations step.
  5. Clear any enabled operations check boxes and click LatLonListZipCode to enable only the LatLonListZipCode operation.

    Ex create
  6. In the lower-right corner, click Next > to proceed to the Review step.
  7. In the Name field, enter LatLongLkp to provide the class name and identifier for the service.
  8. In the Parent class field, enter or select PegaHR-Int.
  9. Under Choose application layer, select HR Apps.
  10. Under Add to ruleset, select Existing to enable the ruleset name and version options.
  11. In the Ruleset field, select HRAppsInt.
  12. In the Version field, select the highest available version.

    Review page
  13. In the lower-right corner, click Create to create all the relevant rules for the new SOAP Integration.

2 Create an XML parse rule to extract the latitude and longitude values from the SOAP connecter response

The XML rule is now ready to parse the incoming XML response and can extract the information contained between < latLonList> and </latLonList>.
  1. From the Record Explorer, select Integration-Connectors > Connect SOAP to launch the Connect SOAP rule instances.

  2. Filter the Service Name column to locate and open the newly created LatLonListZipCode Connect SOAP.
  3. Select the LatLonListZipCode connect SOAP instance.
  4. Click the Request tab to open the Request page.
  5. Under Request parameters, verify the Map from Key field is configured with the .LatLonListZipCodeZipCodeList property.
  6. Click the Response tab to open the Response page.

  7. Under Response parameters, from the Map to drop-down, select XML Parse Rule.
  8. In the Map to Key field enter ParseLatLongResponseXML to provide a name for the new parse XML rule.

    Parameters
     
  9. Click the crosshairs icon next to ParseLatLongResponseXML field to open the create Parse XML form.
  10. In the Root Element Name field, enter dwml to identify the XML root element from the service response.
  11. From the Add to ruleset drop-down, select HRAppsInt and the highest available version.
  12. In the upper-right corner, click Create and Open to create the Parse XML rule.
  13. On the Mapping tab, select dwml and click Add Element to add a new child element.

    New element
     
  14. Double-click the _new_ element to open the modal form for the element.
  15. In the Node Name field, enter latLonList.
  16. In the Property field, enter .LatLonListZipCodeListLatLonOut.
  17. Click OK to save the element properties.

    nodename
     
  18. Click Save to save the Parse XML rule.
  19. Click the LatLonListZipCode Connect SOAP rule tab.
  20. On the Response tab, under Response Parameters, from the Map to Key drop-down, select ParseLatLongResponseXML dwml as the new value.

    Parameters 2
     
  21. Save the SOAP connector rule.

    3 Create and configure a data page to invoke the SOAP connector

    1. In Dev Studio, select Create > Data Model > Data Page to launch the Create Data Page rule form.
    2. In the Label field, enter LatLongLookup.
    3. From the Apply to drop-down, select PegaHR-Int-LatLongLkp-ndfdXML to create the data page in the same context as the SOAP connector.
    4. From the Add to ruleset drop-down, select HRAppsInt and the highest available version.
    5. In upper-right corner, click Create and open to create the data page.
    6. On the Definition tab, under Data sources, from the Type drop-down, select SOAP.
    7. In the Name field, enter LatLonListZipCode.
    8. In the Request Data Transform field, enter LatLongRequest.
    9. Click the crosshairs icon to create a new data transform.

      data source
    10. In upper-right corner, click Create and open to create the data transform.
    11. On the Definition tab, configure Step 1 with the following property values.

       

      Property Name Value
      Action Set
      Target .LatLonListZipCodeZipCodeList
      Relationship equal-to
      Source Param.ZipCode
    12. In the upper-right corner, click Save to save the data transform.
    13. Return to the Edit: LatLongLookup data page tab.
    14. Below Data sources, under the Request Data Transform field, click Parameters.

      parameters 3
    15. In the Parameters for LatLongRequest pop-up, select Pass current parameter page to enable the parameters for Request data transform.
    16. Click Submit.
    17. Click the Parameters tab to open the parameters page.
    18. Add a new parameter that uses the following information.

       

      Property Name Value
      Name ZipCode
      Description Please enter a Zip code for which you want to fetch Latitude and Longitude
      Data type String
      Required Yes
      In/Out In
    19. Click the Load Management tab, select Limit to a single data page.
    20. Save the Data page.

    4 Confirm your work

    1. Open the D_LatLongLookup data page.
    2. In the upper-right corner, click Actions to open the actions menu.
    3. In the actions menu, click Run to run the data page.
    4. In the Run window, in the Value field, enter 02142 for the ZipCode parameter.

      You can enter any valid zip code in the Value field.
    5. Click Run.
    6. Verify the LatLonListZipCodeListLatLonOut property return Latitude and Longitude coordinate values for the provided zip code.

      run results

    Optional - Create and configure a Location look up case type to invoke the data page

    1. Create a new section in the same class as the parse XML rule and name it Location.

      The class name for the parse XML rule is PegaHR-Int-LatLongLkp-ndfdXML.
    2. In the Location section rule, add LatLonListZipCodeListLatLonOut as a read-only property.

      location section
    3. Create a Location case type, and add a stage named Location Details.
    4. Configure the Location case type to look like the following image.

      stage
    5. Add a ZipCode field to the Location information view.
    6. In the Location information section, add a Button element and configure the Refresh this section action to refresh the section and display the LatLonListZipCodeListLatLonOut property value.

      section
    7. Embed the Location section inside the Location Information section and configure the embedded section to use a data page as the Page context and pass the .ZipCode property as the parameter value.

      To embed a section, in Location Information section, click + Add new > Advanced > Embedded section.
      embedded section
    8. Verify your work by creating an instance of the Location case type.
    9. On the Location information page, enter a zip code and click Check to refresh the section and display the LatLongListZipCodeListLatLonOut property value.
       

      verification
       

    If you are having problems with your training, contact Pega Academy technical support.

    Did you find this content helpful?

    Want to help us improve this content?

    Suggest an edit

    We'd prefer it if you saw us at our best.

    Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

    Close Deprecation Notice