Working With WSDL File
WSDL stands for Web Service Description Language. It describes the web services and exchanges the information in a decentralized or distributed environment. It is used to create a relationship between the service requester and the service provider. It is an XML based language to describe the functionality of a SOAP-based web service.
In this section, we will learn how to deal with WSDL file in SoapUI.
Features of WSDL
There are following features of WSDL:
WSDL Schemas in terms of Soap and XML:
WSDL is an important component for building web applications. It facilitates various applications that are built on multiple languages to interact with each other. WSDL is used as the combination of SOAP and XML schemas that provide communication between the clients and web services over the internet. To read the WSDL file, the client program must connect to the Web service and specify the operation required to connect to the Web server.
WSDL Document Elements
Structure of WSDL Document
The following code snippet shows the structure of WSDL documents.
We can also add other elements such as extension elements and service elements combined into a single WSDL document with possible definitions of multiple web services.
The following are the four major transmissions of the WSDL that support endpoint in the SoapUI tool.
One way: A one-way service can only receive one-way messages. It means that the client can send a request to the server by executing an operation with a single input element.
Request and Response: The Request and Response service is used to send a request to the server and receive a response from the web server. It has two operation elements. The first input element is followed by another element to send and receive the request and response in the web service.
Solicit Response: A solicit response consists of an operation involving two input elements. The first input element contains a server request for the client, followed by one input element of the client's response back to the server.
Notification: A server sends information or message to a client machine. Therefore, a notification consists of an operation that includes an input element to send a notification to the client.
Create a WSDL File
For creating a WSDL file, we have to follow the steps given below:
Step 1: Go to the File -> New SOAP Project.
Step 2: Click on the New SOAP Project; it shows the below screen.
Step 3: Type the following WSDL URL in the Initial WSDL text box, as shown below.
After that click on the OK button.
It automatically sets the project name. We can also change the project name during the initialization of the WSDL URL.
Step 4: SoapUI will load and parse the specified WSDL URL contents into the object model, as shown below.
Note: When we work with a project, SoapUI saves the WSDL file to the cache to avoid unnecessary requests. To use a WSDL file in the SoapUI, we need to set the cache definition's property to FALSE.
We can explore the WSDL file's service by double-clicking on the Navigator to open the editor.
The overview tab is used to display the general information of the WSDL file, such as:
The service endpoint is used to include the endpoint for the interface in the WSDL file. Additionally, we can specify more than one endpoint for a WSDL service that requires authentication.
The WSDL Content provides detailed information of the WSDL file.