Skip to main content

Creating a SOAP connector

Archived

4 Tasks

30 mins

Visible to: All users
Intermediate Pega Platform 8.5 Data Integration English
This content is now archived and is no longer updated. Progress is not calculated. Pega Cloud instances are disabled, and badges are no longer awarded. Click here to continue your progress in the latest version.

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 find 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.

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 lookup 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 lookup case type to invoke the data page.

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

Role User name Password
Senior System Architect SSA@TGB rules

    Challenge Walkthrough

    Detailed Tasks

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

    1. In Dev Studio, click Configure > Integration > Connectors > Create SOAP Integration to open the New SOAP Integration form.

    2. On the New SOAP Integration form, click 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. Click Next to proceed to the Select Operations step.
    5. Clear any enabled operations check boxes and select LatLonListZipCode to enable the operation.

      create-soap-connector
    6. 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. Select the HR Apps application layer.
    10. In the Add to ruleset section, click Existing to enable the ruleset name and version options.
    11. Select the highest available version of the HRAppsInt ruleset.
      create-soap-connector-review
    12. 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

    Tip: The XML rule is now ready to parse the incoming XML response and can extract the information contained between < latLonList> and </latLonList>.
    1. On the Records Explorer, click Integration-Connectors > Connect SOAP to view a list of SOAP connector rule instances.

    2. Filter the Service Name column to locate and open the newly created LatLonListZipCode Connect SOAP.
    3. On the Request tab under Request parameters, verify the Map from Key field is configured with the .LatLonListZipCodeZipCodeList property. 
    4. On the Response tab, in the Response parameters section, in the Map to list, select XML Parse Rule.

    5. In the Map to Key field, enter ParseLatLongResponseXML to provide a name for the new parse XML rule.

      Response xml
       
    6. Click the Open icon next to ParseLatLongResponseXML field to create the Parse XML record.
    7. In the Root Element Name field, enter dwml to identify the XML root element from the service response.
    8. From the Add to ruleset list, select HRAppsInt and the highest available version.
    9. Create the Parse XML rule.
    10. On the Mapping tab, select dwml and click Add Element to add a new child element. 
      create-a-soap-connector-parse-xml
    11. Double-click the _new_ element to open the User Data dialog for the element.
    12. In the Node Name field, enter latLonList.
    13. In the Property field, enter or select .LatLonListZipCodeListLatLonOut.
      create_a_soap_connector_nodename_details
    14. Save your changes to the Parse XML rule.
    15. Return to the LatLonListZipCode Connect SOAP rule tab.
    16. On the Response tab, in the Response Parameters section, in the Map to Key field, enter or select ParseLatLongResponseXML dwml as the new value.
      response-parameters
    17. In the warnings section, click Review/Edit to view the guardrail warnings. 
      guardrail warnings
    18. On the Service tab, in the Connection section, in the Service endpoint URL field, enter =D_pxGetApplicationSettingValue[OwningRuleset:PegaHR, Purpose:ServiceEndpointURL].pySettingValue.

      The data page D_pxGetApplicationSettingValue rule requires two parameters OwningRuleset and Purpose.

    19. Repeat step 18 for the Response timeout and Authentication profile fields using the details in the following table.
      OwningRuleset Purpose
      PegaHR ResponseTimeout
      PegaHR AuthenticationProfile
      guardrail-correction
    20. Save the SOAP connector rule to verify that the warnings clear.

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

    1. In Dev Studio, click Create > Data Model > Data Page to launch the Data Page Record Configuration form.
    2. In the Label field, enter LatLongLookup.
    3. In the Apply to field, enter or select PegaHR-Int-LatLongLkp-ndfdXML to create the data page in the same context as the SOAP connector.
    4. In the Add to ruleset list, select HRAppsInt and the highest available ruleset version.
    5. Create and open the data page.
    6. On the Definition tab, in the Data sources section, in the Type list, select SOAP.
    7. In the Name field, enter or select LatLonListZipCode.
    8. In the Request Data Transform field, enter LatLongRequest.
    9. Click the Open icon to create a new data transform.
    10. Create and open the data transform.
      create_a_soap_connector_datapage_datasources
    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. Save your changes to the data transform.
    13. Return to the Edit: LatLongLookup data page tab.
    14. In the Data sources section, under the Request Data Transform field, click Parameters.
      create_a_soap_connector_datapage_datasources_parameters
    15. In the Parameters for LatLongRequest dialog box, select Pass current parameter page to enable the parameters for the Request data transform.
    16. Click Submit.
    17. In the Parameters tab add a new parameter that uses the following information:
      Field 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
    18. In the Load Management tab, select Limit to a single data page.
    19. Save your changes to the data page.

    4 Confirm your work

    1. Open the D_LatLongLookup data page.
    2. Click Actions > Run to run the data page.
    3. In the Run window, in the Value field, enter 02142 for the ZipCode parameter.
      Note: You can enter any valid U.S. zip code in the Value field.
    4. Click Run.
    5. Verify the LatLonListZipCodeListLatLonOut property returns the latitude and longitude coordinate values for the provided zip code.
      create_a_soap_connector_datapage_runresults

    Optional: Create and configure a Location lookup 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.
      Tip: 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 then edit the Create stage name to Location Details.
    4. Configure the Location case type to look like the following image.
      Location 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.
      create_a_soap_connector_location_information_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 to pass the .ZipCode property as the parameter value.
      Tip: To embed a section, in the Location Information section, click Add new > Advanced > Embedded section.
      create_a_soap_connector_datapage_embeded_section
    8. Confirm 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.

      create_a_soap_connector_datapage_verification
       


    Available in the following mission:

    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