Back Forward How to test a SOAP service rule with the Run Rule feature

About Service SOAP rules

Services start their processing in response to a request from an external application. Before you add the external application to your testing process, use the Run Rule feature to verify that the service processes data appropriately by manually providing some representative data to process. You specify a test page for the rule to use, provide sample data as the input, run the rule, and examine the results. Additionally, if Automated Testing is enabled, you can save the test data and its results as a test case rule.

Before you Begin

Before you begin, determine how you will provide the sample data for the service rule to process. For help with this step, and for information about additional ways to test your services, see the Pega Developer Network document PDNTesting Services and Connectors.

Run the Rule

Complete the following steps:

  1. Save the rule.
  2. Optional. To trace the rule as it runs, select Run > Trace Open Rule from the menu. For information, see Tracer tool  — Tracing services.
  3. Click the Run toolbar button Run.
  4. Fill out the fields in the form as described in the following table:

    Field

    Description

    Test Cases

    If Automated Testing is enabled, select Run Against a saved test case. Then choose an individual test case from the drop-down list. For more information, see the Pega Developer Network article PDNPRKB-25144 How to create and execute test cases for SOAP Service rules.

    Requestor Context

    Select one of the following to define the requestor session is to be used in the test:

    • Use current requestor context — Runs the rule in your session, that is, with your RuleSet list, privileges, and current clipboard
    • Initialize service requestor context — Run the rule in a newly created service requestor session based on the APP requestor type and, if the service package requires authentication, another Operator ID instance.
    Authentication
    User ID

    If you selected Initialize service requestor context, and the service package for the service requires authentication, enter the Operator ID to be used to test the service.

    Authentication
    Password

    If you selected Initialize service requestor context, and the service package instance for the service requires authentication, enter a password for the Operator ID.

    Enter Request Data

    Select one of the following to define the source of request data values for this test:

    • Specify individual request values — This option appears only when all elements of the message are simple text values, not arrays or complex values of type XML Page.
    • Supply SOAP Envelope — You can enter an entire SOAP message including the header.
    SOAP Header Values

    Array If you selected Specify individual request values for the previous field, enter in the Value field a literal constant value for each Header Field row on the Request tab. Enter a value that matches the XSD type shown.

    SOAP Parameter Values

    Array If you selected Specify individual request values for the previous field, enter in the Value field a literal constant value for each Request Parameters row listed on the Request tab. Enter a value that corresponds to the XSD data type shown.

    SOAP Request Envelope

    If you selected Supply Soap Envelope, enter or paste a well-formed and valid XML document in the SOAP Request Envelope text area, starting with the <?xml version=“1.0” ?> declaration.

    If the service expects requests containing an array element or elements, a skeleton document is provided as a starting point.

  5. Click  Execute  to run the rule. The system runs the rule and displays the results.
  6. Optional. Select Tools > Clipboard to see the clipboard pages that were generated.
  7. Run the rule again using different data, as necessary.
  8. Optional. If Automated Testing is enabled, you can click  Save as Test Case  to create a test case rule that holds the test data and the results. For information about running test cases, see the Pega Developer Network article PDN25144 How to create and execute test cases for SOAP Service rules.

zzz About Service SOAP rules