WSDL and XML
Estimated study time: 12 minutes.
WSDL (Web Services Description Language) is an XML-based format used to describe exactly what a web service does, how to call it, and what kind of response to expect.
Why WSDL Matters
Before a client can talk to a SOAP web service, it needs to know: What operations are available? What parameters do they need? What will the response look like? A WSDL document answers all of that in a machine-readable way.
Core Parts of a WSDL Document
- types — the data types used by the service (usually defined with XSD).
- message — the individual pieces of data being exchanged.
- portType — the set of operations the service supports.
- binding — how those operations map to an actual protocol (like SOAP over HTTP).
- service — the actual network address (endpoint) where the service can be reached.
A Simplified Example
<definitions name="StudentService">
<message name="GetStudentRequest">
<part name="StudentID" type="xsd:int"/>
</message>
<message name="GetStudentResponse">
<part name="Name" type="xsd:string"/>
</message>
<portType name="StudentPortType">
<operation name="GetStudent">
<input message="GetStudentRequest"/>
<output message="GetStudentResponse"/>
</operation>
</portType>
</definitions>
💡 Tip: Think of WSDL as a contract: it lets tools auto-generate client code for calling a SOAP service correctly, without a developer needing to read the service's internal implementation.