Example of using the SOAP web service action

Use the SOAP web service action to pass two numeric values and return the sum from an online calculator application.

Procedure

To make a SOAP web services call, perform the following steps:

  1. Double-click or drag the SOAP web services action.
  2. Select a connection method:
    • To connect using a URI, enter the URI, for example, http://www.dneonline.com/calculator.asmx?WSDL .
    • To connect using a file, select a file from the Control Room or the Desktop, or insert a variable.
  3. Optional: Enter the SOAP endpoint in the Address location field.
    If you specify the address location, the bot uses it during execution; otherwise, the bot uses the address location from the WSDL file.
    Note: If you are creating the SOAP URI manually and not using the Build SOAP request option, go to step 6.
  4. Click Build SOAP request.
    The SOAP request window appears, displaying the services and ports, with details about their operations and parameter.
  5. In the SOAP request window, expand the service for which you want to view the list of ports. Click the required port to display the list of available operations. Select the required operation and click Apply to retrieve the operation details from the SOAP request.
    If you use the Build SOAP request option, Services, Port, Operation, and Operation parameters fields are automatically populated with details based on the operation you selected. Go to step 10.
  6. In the Service field, enter the service name.
    This field identifies the collection of ports supported by the web service. It holds the @service name value for a SOAP web service call, for example, Calculator.
  7. Optional: In the Port field, enter the endpoint to connect with.
    If you do not specify a port, the bot will use the first port mentioned in the WSDL file based on the service selected. However, if that port is not supported by the SOAP web service, bot execution will fail.
    This field holds the @binding name value for a SOAP web service call, for example, CalculatorSoap.
  8. Select the SOAP version of the endpoint that you specified in the Port field.
    Choose either 1.1 or 1.2.
    Note: The SOAP version can be determined using one of following namespaces specified in the WSDL file:
    • SOAP 1.1 namespace: http://schemas.xmlsoap.org/soap/envelope
    • SOAP 1.2 namespace: http://www.w3.org/2003/05/soap-envelope
  9. In the Operation field, enter the name of the service function for the endpoint that you specified in the Port field.
    The bot execution fails if either of the following is true:
    • The port mentioned in the port field does not have any operations.
    • The operation mentioned in the SOAP request for the port is unavailable.
    This field holds the @operation name value for a SOAP web service call, for example, Add.
  10. Select Operation parameters or Raw data parameters to provide the parameter details.
    Note: If you have selected Build SOAP request, the parameter details table in the Operation tab is automatically populated with the parameters of the selected operation. Provide values for these parameters. You can also add, edit, or delete the parameters for a particular operation.
    • If you select Operation parameters, enter the name and value of each parameter. For example, enter the following values:
      1. intA in the first Name field
      2. 10 in the first Value field
      3. intB in the second Name field
      4. 20 in the second Value field
    • If you choose Raw data parameters, select Parameters or Credential parameters.
  11. Parameters: You can use the credential values from the credential locker without exposing the credentials (username or password) in plain text in the raw data. To do so, you must first map the credential in the credential mapper and use the reference name in the raw data within curly braces.

    For example, in the raw data, you provided the password in plain text to authenticate to the server.

    <aut:AuthHeader>
    <aut:Password> abc@123</aut:Password>
    </aut:AuthHeader>
    
    To use the password from the credential locker, perform the following steps:
    1. Click Add substitution.
      Enter the reference name, for example, pwd, in the Name in XML field. Select Credential to use a value available in the credential vault, Variable to use a credential variable, or Insecure string to manually specify the value you want to use.
      For more information about credential vaults and how to use them, see Credentials and lockers in the Credential Vault.
    2. Click Add
    3. Specify the reference in the raw data within curly braces, as follows:
      <aut:AuthHeader>
      <aut:Password>{{pwd}}</aut:Password>
      </aut:AuthHeader>
      
      The reference name pwd specified in raw data will substitute the corresponding value stored in the credential vault.
      Ensure that you enter the reference name in the same format as specified in Add substitution. For example, if you have entered password as pwd in Add substitution and enter password as reference name in the raw data, when you run the bot, the bot will encounter an error.
  12. Credential parameters: If you want to enter raw data parameters as credential. You can choose Credential to use a value available in the Credential Vault or select Variable to use a credential variable or Insecure string to manually specify the value you want to use.
  13. Select No Authentication or Basic from the Authentication Mode list.
    • If you select No Authentication, proceed to the next step.
    • If you select Basic, enter your credentials.
  14. Optional: Provide a Client certificate by selecting a file from the Control Room or your desktop, or insert a variable.
  15. Optional: Provide custom headers.
  16. Optional: Provide a file to save the XML output.
  17. Select Complete response or Selected response to narrow the scope of the response.
    • If you select Complete response, proceed to the next step.
    • If you select Selected response, perform the following steps if you are creating the Xpath expression manually and not using the Build Xpath option.
      1. Provide the XPath expression. For example:
        /*[local-name()='Envelope' and namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/']/*[local-name()='Body' and namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/']/*[local-name()='AddResponse' and namespace-uri()='http://tempuri.org/']/*[local-name()='AddResult' and namespace-uri()='http://tempuri.org/']
      2. Select a section of the XML output: Values, Inner XML, or Outer XML.
      3. If you select the option Values, choose return content as: String delimited by or List of strings.
        • If you select String delimited by, choose a delimiter option: Pipe, Semicolon, or Custom.
          If you select Custom, enter variables or characters in the Custom Delimiter (optional) field.
          Note: The special character dollar sign ($) as delimiter is not supported.
        • Select List of strings to return the output of the soap response as list of strings.
          Note: You can only specify a list type of variable with data type as strings.
  18. Click Build Xpath.
    The Output preview window appears.
  19. Select the appropriate node from the response body. The XML path is automatically created. Click Apply.
    If you use the Build Xpath option, XPath expression and Value fields are automatically populated with details based on the operation you selected.
  20. Optional: To set a time-out value when you send a SOAP request and receive a response, in the Wait for action to complete field, specify the wait time (in milliseconds).
    By default, the wait time is 60000 milliseconds.
  21. Configure the P12 certificate:
    • To get the SSL certification file, select one of the following options: Control Room file, Desktop file, or Variable
    • Configure the Keystore properties:
      • Keystore file (Optional): To provide the keystore file in. p12 format, select one of the following options: Control Room file, Desktop file, or Variable. The keystore file includes the client's private key and certificate.
      • Keystore password (Optional): To provide the password for the keystore file, select one of the following options: Credential, Variable , or Insecure string. The password is used to access the keystore file.
  22. Select a variable to store the XML output.
    For example, prompt-assignment
  23. Verify the output of the SOAP web service action by inserting a Message box action with the variable prompt-assignment in the body message.
    When you run the bot, the message box should show 30.