Skip to main content

Creating a SOAP connector

3 Tasks

20 mins

Visible to: All users
Intermediate
Pega Platform '24.2
Data Integration
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 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 pega123!

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

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

Challenge Walkthrough

Detailed Tasks

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

  1. In the Pega instance for the challenge, enter the following credentials:
    1. In the User name field, enter SSA@TGB.
    2. In the Password field, enter pega123!.
  2. In Dev Studio, click Configure > Integration > Connectors > Create SOAP Integration to open the New SOAP Integration form.

  3. On the New SOAP Integration form, click Upload WSDL from URL to enable the option to connect to a URL.
  4. In the Upload WSDL from URL field, enter https://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl.

  5. Click Next to proceed to the Select Operations step.
  6. Clear any enabled operations check boxes and select LatLonListZipCode to enable the operation.

    Creating the SOAP connector
  7. Click Next to proceed to the Review step.
  8. In the Name field, enter LatLongLkp to provide the class name and identifier for the service.
  9. In the Parent class field, confirm that the value is PegaHR-Int.
  10. Confirm that the HR Apps Application Layer is selected.
  11. In the Add to Ruleset section, click Existing to enable the Ruleset name and version options.
  12. Select the highest available version of the HRAppsInt Ruleset.
    review screen
  13. 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 SOAP connector.
  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 and open 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
    Note: The three guardrail warnings detailed above get addressed with the following step configurations.
  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 three 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.
    create_a_soap_connector_datapage_datasources
  10. Create and open 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. 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.

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.
     create_a_soap_connector_location_section_xmlfield_edited
     
  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 case type
  5. Add a ZipCode field to the Location information View.
  6. In the Check location details Section, add a button element and configure the Refresh this Section Action to refresh the Section and display the .LatLonListZipCodeListLatLonOut property value.
    Check location details section
  7. Embed the Location Section inside the Check location details 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 Check location details 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

 


This Challenge is to practice what you learned in the following Module:


Available in the following mission:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

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