Creating a SOAP connector
3 Tasks
30 mins
Intermediate
Pega Platform '23
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! |
Challenge Walkthrough
Detailed Tasks
1 Create a SOAP Integration Rule to connect to a ZIP code look up service
- In the Pega instance for the challenge, enter the following credentials:
- In the User name field, enter SSA@TGB.
- In the Password field, enter pega123!.
-
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 three guardrail warnings detailed above get addressed with the following step 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 three 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.
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.
Want to help us improve this content?