Creating a SOAP connector
Archived
3 Tasks
30 mins
Intermediate
Pega Platform 8.6
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 | rules |
Challenge Walkthrough
Detailed Tasks
1 Create a SOAP Integration rule to connect to a ZIP code look up service
-
In Dev Studio, click Configure > Integration > Connectors > Create SOAP Integration to open the New SOAP Integration form.
- On the New SOAP Integration form, click Upload WSDL from URL to enable the option to connect to a URL.
-
In the Upload WSDL from URL field, enter https://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl.
- Click Next to proceed to the Select Operations step.
-
Clear any enabled operations check boxes and select LatLonListZipCode to enable the operation.
- Click Next to proceed to the Review step.
- In the Name field, enter LatLongLkp to provide the class name and identifier for the service.
- In the Parent class field, confirm that the value is PegaHR-Int.
- Confirm that the HR Apps application layer is selected.
- In the Add to ruleset section, click Existing to enable the ruleset name and version options.
- Select the highest available version of the HRAppsInt ruleset.
- 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>.
-
On the Records Explorer, click Integration-Connectors > Connect SOAP to view a list of SOAP connector rule instances.
- Filter the Service Name column to locate and open the newly created LatLonListZipCode SOAP connector.
- On the Request tab under Request parameters, verify the Map from Key field is configured with the .LatLonListZipCodeZipCodeList property.
-
On the Response tab, in the Response parameters section, in the Map to list, select XML Parse Rule.
-
In the Map to key field, enter ParseLatLongResponseXML to provide a name for the new parse XML rule.
- Click the Open icon next to ParseLatLongResponseXML field to create the Parse XML record.
- In the Root Element Name field, enter dwml to identify the XML root element from the service response.
- From the Add to ruleset list, select HRAppsInt and the highest available version.
- Create and open the Parse XML rule.
- On the Mapping tab, select dwml and click Add Element to add a new child element.
- Double-click the _new_ element to open the User Data dialog for the element.
- In the Node Name field, enter latLonList.
- In the Property field, enter or select .LatLonListZipCodeListLatLonOut.
- Save your changes to the Parse XML rule.
- Return to the LatLonListZipCode Connect SOAP rule tab.
- On the Response tab, in the Response parameters section, in the Map to key field, enter or select ParseLatLongResponseXML dwml as the new value.
- In the warnings section, click Note: The guardrail warnings get addressed with the followed steps configurations.
to view the guardrail warnings.
- 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.
- Repeat step 18 for the Response timeout and Authentication profile fields using the details in the following table.
OwningRuleset Purpose PegaHR ResponseTimeout PegaHR AuthenticationProfile - Save the SOAP connector rule to verify that the warnings clear.
3 Create and configure a data page to invoke the SOAP connector
- In Dev Studio, click Create > Data Model > Data Page to launch the Data Page Record Configuration form.
- In the Label field, enter LatLongLookup.
- 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.
- In the Add to ruleset list, select HRAppsInt and the highest available ruleset version.
- Create and open the data page.
- On the Definition tab, in the Data sources section, in the Type list, select SOAP.
- In the Name field, enter or select LatLonListZipCode.
- In the Request Data Transform field, enter LatLongRequest.
- Click the Open icon to create a new data transform.
- Create and open the data transform.
- 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 - Save your changes to the data transform.
- Return to the Edit: LatLongLookup data page tab.
- In the Data sources section, under the Request Data Transform field, click Parameters.
- In the Parameters for LatLongRequest dialog box, select Pass current parameter page to enable the parameters for the Request data transform.
- Click Submit.
- 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 - In the Load Management tab, select Limit to a single data page.
- Save your changes to the data page.
Confirm your work
- Open the D_LatLongLookup data page.
- Click Actions > Run to run the data page.
- 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.
- Click Run.
- Verify the LatLonListZipCodeListLatLonOut property returns the latitude and longitude coordinate values for the provided zip code.
Optional: Create and configure a Location lookup case type to invoke the data page
- 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.
- In the Location section rule, add .LatLonListZipCodeListLatLonOut as a read-only property.
- Create a Location case type, and then edit the Create stage name to Location Details.
- Configure the Location case type to look like the following image.
- Add a ZipCode field to the Location information view.
- 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.
- 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.
- Confirm your work by creating an instance of the Location case type.
-
On the Location information page, enter a zip code and click Check to refresh the section and display the LatLongListZipCodeListLatLonOut property value.