What is WSDL?
π‘ Concept Name
WSDL (Web Services Description Language) β An XML-based language used for describing the functionality offered by a web service.
π Quick Intro
WSDL defines what a web service does, how to access it, and where it can be found. It enables tools to generate client/server stubs automatically.
π§ Analogy / Short Story
Think of WSDL like a restaurant menu. It tells you whatβs available (operations), the ingredients (input/output), and how to place an order (bindings).
π§ Technical Explanation
- π Written in XML format.
- π Describes operations (methods), messages, and endpoints.
- π Supports binding protocols like SOAP or HTTP.
- π Used for contract-first web service development.
- π§° Tools like
wsdl.exe
,svcutil
in .NET can generate code from WSDL.
π― Purpose & Use Case
- β Enables client code generation for SOAP web services.
- β Used in service registries for discovery and binding.
- β Ensures strict service contracts in SOA environments.
π» Real Code Example
<definitions name="CalculatorService"
targetNamespace="http://example.com/calculator"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<message name="AddRequest">
<part name="a" type="xsd:int"/>
<part name="b" type="xsd:int"/>
</message>
<message name="AddResponse">
<part name="result" type="xsd:int"/>
</message>
<portType name="CalculatorPortType">
<operation name="Add">
<input message="tns:AddRequest"/>
<output message="tns:AddResponse"/>
</operation>
</portType>
</definitions>

π MCQs
Q1. What does WSDL stand for?
- Web SOAP Deployment List
- Web Services Definition Language
- Web Services Description Language
- Wide Service Deployment Language
Q2. What format is WSDL written in?
- YAML
- JSON
- XML
- CSV
Q3. Which protocol is commonly associated with WSDL?
- FTP
- HTTP
- SOAP
- SMTP
Q4. What tool can generate code from WSDL in .NET?
- dotnet-wsdl
- xsd.exe
- svcutil
- cli-tool
Q5. What is defined inside WSDL's 'portType'?
- Data types
- Endpoints
- Operations
- Bindings
Q6. What section of WSDL describes the message types?
- binding
- port
- service
- message
Q7. Is WSDL used in RESTful APIs?
- Yes
- No
- Sometimes
- Only in ASP.NET Core
Q8. What file extension does WSDL usually have?
- .xml
- .soap
- .wsdl
- .xsd
Q9. Can a WSDL define multiple operations?
- No
- Yes
- Only in SOAP 1.2
- Only with .NET
Q10. What is the main role of WSDL?
- Deploy services
- Serialize JSON
- Define service contract
- Run test scripts
π‘ Bonus Insight
Though WSDL is mainly used in SOAP-based services, understanding it helps in working with legacy systems and enterprise-level integrations.
π PDF Download
Need a handy summary for your notes? Download this topic as a PDF!