
An XML-based language used to describe the capabilities, location, and communication protocols of a Web Service. Pronounced wiz-dull, it acts as a public contract or a technical manual that tells a client application exactly how to interact with the service.
Core Components
A WSDL file defines a service using several key elements that describe both what the service does and how to access it:
- Types: Defines the data types used in the messages (usually via XML Schema).
- Message: Defines the data elements for each operation (the inputs and outputs).
- PortType (or Interface): Describes the operations that can be performed and the messages involved.
- Binding: Specifies the communication protocol (like SOAP) and data format for a particular PortType.
- Service: Specifies the network address (URL) to reach the service.
How WSDL Works
WSDL is the description pillar of the SOA (Service-Oriented Architecture) triad, working alongside SOAP (the protocol) and UDDI (the directory).
- The Provider publishes the WSDL file.
- The Client reads the WSDL to understand what methods are available.
- The Client generates code (a proxy or stub) based on the WSDL to send the correct request.
| Feature | Description |
| Language | XML (Extensible Markup Language) |
| Common Protocol | Typically used with SOAP (Simple Object Access Protocol) |
| Usage | Automated toolsets use WSDL to generate client-side code automatically. |
| Version | WSDL 1.1 is most common; WSDL 2.0 is the current W3C recommendation. |
Example Snippet
While a full WSDL is quite long, a simplified operation definition looks like this:
<operation name="GetStockPrice">
<input message="tns:GetStockPriceRequest"/>
<output message="tns:GetStockPriceResponse"/>
</operation>
Note: Think of WSDL as a restaurant menu: it lists what dishes are available (operations), what ingredients you need to provide (input), and what you’ll get back (output), but it doesn’t tell you how the chef actually cooks the meal.