Import a WSDL-based Web service

Relevant for: API testing only

Import your service

  1. In the toolbar, click the Import WSDL button and select Import WSDL from File or ALM Application Component or Import WSDL from URL or UDDI.

  2. Select the source:

    For File System or ALM Application Components imports In the Import WSDL dialog box, navigate to the location of the WSDL file and select it.
    For URL imports
    1. In the Import WSDl dialog box, select URL.

    2. Click the Browse button adjacent to the Address field.

    3. In the browser window that opens, navigate to the URL containing the WSDL file.

    4. Close the browser window. The URL is automatically entered in the Address field.

    For UDDI imports
    1. In the Import WSDL dialog box, select UDDI.

    2. Click the Browse button adjacent to the Address field.

    3. In the Select Service from UDDI dialog box that opens, specify the UDDI address and click Search. A list of all WSDL files saved in this UDDI location is displayed.

    4. From the list of WSDL files, select the file(s) to import and click OK. The address and file is automatically added in the Address field.

  3. If your WSDL must be accessed through a secure server or proxy machine set the connection information:

    1. In the Import WSDL from URL or UDDI dialog box, click Advanced Settings to expand the dialog box.

    2. Enter the authentication information or the proxy server details as needed.

  4. Mark the WSDL as a server response (optional):

    1. In the Import WSDL from URL or UDDI dialog box, click Advanced Settings to expand the dialog box.

    2. At the bottom of the dialog box, select the Import as server option.

  5. Click OK to import the service. If the import succeeds, the Toolbox displays the service, its ports, and operations under the Web Services node.

Back to top

Validate the WSDL file - optional

To check the WSDL's compliance with the WS-I standard, in the Toolbox pane, right-click the service nodeand select Validate WS-I Compliance. The Output window shows the WS-I validation results.

Note: These validations apply only to Document/Literal type services, but not RPC.

Update your WSDL information - optional

  1. If the URL for your imported Web Service changes, you can update the URL after importing without the need to reimport the service and recreate the tests using the imported service methods.

    In the Toolbox pane, right-click the top-level service node and do one of the following:

    Update WSDL: This updates the service details from the source provided when you first imported the WSDL file.
    Update WSDL from:

    This updates the service URL and details from one of the following sources:

    • URL or UDDI: Enables you to reimport the WSDL file (containing the service model details) from a different URL or UDDI source.

    • File or ALM Component: Enables you to reimport the WSDL file from the file system or ALM.

    The service model details are updated in the Toolbox pane and the steps using the service model methods are also updated.

    IMPORTANT: The service or service location URL must be accessible when updating the service.

Back to top

Add input attachments to the test - optional

  1. Select the Web Service call step in the canvas and open the Attachments tab in the Properties pane.

  2. In the upper pane, select an attachment Type: DIME or MIME.

  3. Click in the Attachments row and click the Add button to add an array element.

  4. Select a file as the Origin of the attachment using the Browse button .

  5. Select a Content Type. Specify a Content ID or keep the default value, Auto.

Back to top

Validate output attachments

  1. Select the Web Service call step in the canvas and open the Attachments  view in the Properties pane.

  2. Click in the Attachments row in the Checkpoints pane, and click Add to add an array element (it may be necessary to expand the column).

  3. Select the check box adjacent to each item that you want to validate. Specify values for the elements being validated: Content Type and/or Content ID.

  4. To validate content, click the Calculate the file checksum button icon in the Content row. UFT calculates the specified file's checksum using the MD5 Hash function.

    You can also check for received attachments in the test's folder, stored as files with a .bin extension.

Back to top

Configure SOAP Fault information - optional

To apply negative testing to a Web service:

  1. In the canvas, select the step to which to apply the SOAP fault.

  2. In the Properties pane, open the SOAP Fault tab .

  3. Select Fault is expected.

  4. Provide SOAP Fault checkpoint values for the negative testing:

    To work In the XML layout: Expand the SOAP nodes and define Any elements for the SOAP Header and Body. If relevant, provide values for faultcode, faultstring, or faultactor.
    To work with XPath expressions: Click the XPath tab and use the Add button to add new XPath entries. Copy the XPATH entry into the cell.

Back to top