What is a WSDL?
WSDL, or Web Service Description Language, is an XML based definition language. It’s used for describing the functionality of a SOAP based web service.
WSDL files are central to testing SOAP-based services. SoapUI uses WSDL files to generate test requests, assertions and mock services. WSDL files define various aspects of SOAP messages:
- Whether any element or attribute is allowed to appear multiple times
- The required or optional elements and attributes
- A specific order of elements, if it is required
You may consider a WSDL file as a contract between the provider and the consumer of the service. SoapUI supports 1.1 version of the WSDL specification and corresponding bindings for SOAP versions 1.1 and 1.2.
This article explains how to work with WSDL files in SoapUI. If you are looking for a WSDL example, or if you want to learn about the differences between WSDL and WADL, please see SOAP vs REST.
Work with WSDLs in SoapUI
Create Project From WSDL
To take a closer look at a WSDL file, create a new project and import a sample WSDL file:
-
In SoapUI, click or select File > New SOAP Project
-
In the dialog box, specify the following URL in the Initial WSDL field:
http://www.dneonline.com/calculator.asmx?wsdl
-
Leave the default settings and click OK
SoapUI will load the specified WSDL and parse its contents into the following object model:
A WSDL can contain any number of services (the bindings). A binding exposes an interface for the specified protocol. In the example above, the WSDL file exposes two bindings: one for SOAP 1.1 (“CurrencyConverterSoap”) and one for SOAP 1.2 (“CurrencyConverterSoap12”).
Tip: SoapUI saves the WSDL file to a cache to avoid unnecessary network requests when you work with the project. If you want SoapUI to always use a remote WSDL file, set the Cache Definition project property to False.
Explore WSDL
Double-click the service in the navigator to open the editor:
-
The Overview tab contains general information on the WSDL file: its URL, target namespace, etc.
-
The Service Endpoint tab contains endpoints for the interface:
Besides endpoints specified in the WSDL file, you can add endpoints for the service. For each endpoint, you can specify the required authentication.
-
The WSDL Content tab provides more details on the WSDL file
The left panel allows you to browse through the contents of the file. If the service contains several WSDL files, each file is shown in a separate tab.
The toolbar contains the following options:
-
On the WS-I Compliance tab, you can validate your web service against the WS-I Basic Profile (see below).
Validate the WSDL against the WS-I Basic Profile
Since the initial creation of WSDL and SOAP, a multitude of standards have been created and embodied in the Web Services domain, making it hard to agree on exactly how these standards should be used in a Web Service Context. To make interoperability between different Web Service vendors easier, the Web Service Interoperability Organization (WS-I; http://www.ws-i.org) has defined the WS-I Basic Profile - a set of rules mandating how the standards should be used. SoapUI is bundled with version 1.1 of the profile. Use it to check the conformance of a WSDL file and SOAP messages.
To validate the WSDL Service:
-
Double-click the service in the Navigator and switch to the WS-I Compliance tab
-
Click to run validation
- or -
-
Right-click the service in the Navigator
SoapUI will show the validation report:
To validate SOAP messages:
-
Open a SOAP request and send it
-
Right-click within the XML panel of the response editor and select Check WS-I Compliance
SoapUI generates the corresponding report that highlights any compliance errors for the current request/response message exchange.
SoapUI Open Source
- Support for SOAP and REST API Testing.
- Easy multi-environment switching.
- Detailed test history and test comparison reporting.
SoapUI Pro
- Support for SOAP, REST, and GraphQL API Testing.
- Easy multi-environment switching.
- Detailed test history and test comparison reporting.
Generating Code for your WSDL
There are many web service development frameworks that allow you to generate code from a WSDL file. This can be either client code that calls operations specified in a WSDL file, or stubs for implementing the service itself. ReadyAPIvides a graphical interface for most frameworks. To generate it:
-
Right-click the service in the Navigator panel and select the desired framework from the Generate Code popup menu
For example, if you select the Apache CXF framework, you will see the following dialog:
-
Specify the desired settings and click Generate. SoapUI will launch the corresponding command-line tool:
Note: You must specify the path to the corresponding tool on the Tools page of SoapUI Preferences.
The selected tool generates files in the specified folder:
Next Steps
Working With WSDL Coverage
Operations and Requests
Authenticating SOAP Requests
SOAP vs REST APIs: Understand The Differences
SOAP Attchements and Files