Refactoring SOAP APIs

Applies to ReadyAPI 3.56, last modified on November 25, 2024

After the service update, you need to refactor its definition in ReadyAPI to send the requests to the appropriate interfaces.

To use refactoring, you need the ReadyAPI Test Pro license.

1. Open the SOAP Refactoring Dialog

To open the SOAP Refactoring dialog, use one of the following methods:

  • Click Refactoring on the ReadyAPI toolbar.

    ReadyAPI toolbar

    Click the image to enlarge it.

  • Right-click the interface in the Navigator and select Refactor Definition.

    Navigator Context Menu - Refactor Definition

    Click the image to enlarge it.

  • Open the API menu and select Refactor Definition.

    API Menu - Refactor Definition

    Click the image to enlarge it.

The Refactor Definition window will appear.

2. Import the Definition

In the Refactor Definition dialog, you can define refactoring options and import the WSDL definition to be used for refactoring.

The Refactor Definition dialog

Click the image to enlarge it.

  1. Enter the definition file URL in the Definition URL edit box.

    To specify the local files, use the following template: file:/<path>.

    You can also click Browse and select the file in the interface.

  2. Select Create New Requests to create new requests based on the definition.

  3. Select Create Backup to create the project copy before applying the changes.

ReadyAPI locates and analyzes the new WSDL. You can then decide how to map old operations to new ones, if necessary.

3. Refactor Operations

In the Transfer Operations window, you can associate old operations with new ones.

Transferring operations

Click the image to enlarge it.

Here, you can see old operations on the left and new operations on the right. ReadyAPI will try to automatically match old operations with the new ones in accordance with the WSDL analysis.

Old operations without connections appear red, while new operations without connections appear blue.

To associate operations:

  1. Select the new operation.

  2. Select the old operation.

  3. Click Connect.

To remove wrong associations:

  1. Select the new operation.

  2. Select the old operation.

  3. Click Disconnect.

After you connect all operations you need, click Next.

4. Refactor Messages

In the Refactor Schema window, you can refactor the request schema and expected responses. You can change a namespace, reorder elements, and change elements to attributes and conversely.

The Refactor Schema dialog

Click the image to enlarge it.

The interface of the panel is split into three major parts:

Operations Panel

The Operations panel shows the tree view of all operations in the resulting definition. The operations that ReadyAPI failed to refactor will automatically appear red. You can refactor both the requests in the APIs node and ReadyAPI Test SOAP request test steps.

Schema Panel

In the Schemas panel, you can configure the correlation between old and new schemas. The left part of the panel includes the imported schema, the right part – your current schema.

Select an element in each panel and click Connect to associate them. Click Disconnect to remove associations. To discard a part of the new schema, click Discard.

To force a specific value for the last item in the schema, click Set Value and enter the value you need. Other values in the schema will remain unchanged.

To filter out all automatically matched items, select the Filter check box.

To show the schema namespaces, select the Namespaces check box.

Message Panel

In the Message panel, you can see the message in the new and old schema. Select Pretty Print to make the new message text more user-friendly.

To edit the message, select the Edit Manually check box. After applying the changes, click Save and remove the selection from the check box.

If the schema has an error, ReadyAPI will show it in the left panel. Click Clear Error to remove the error notification.

5. Update XPath Expressions

Changes in your API affect the XPath expressions in your project. ReadyAPI will try to automatically update them, but, if there are big changes, you will need to enter new XPath expressions manually.

Updating XPaths Expressions

Click the image to enlarge it.

The left panel shows a tree view of all items in the project with XPath expressions. XPath expressions that ReadyAPI failed to match automatically appear red.

ReadyAPI will not give a new XPath expression, so you need to enter it manually.

Select Filter unchanged paths to hide all expressions you did not refactor and click Finish to end the refactoring.

See Also

Refactoring REST APIs
Documenting Interfaces
SOAP Services

Highlight search results