WSDL defines web services by describing what operations they perform, how they are accessed, and where they are located. It includes elements for defining message types, port types for operations, bindings for protocol and data format details, and services with endpoint addresses. A sample WSDL is provided for a getQuote operation that returns a stock price, demonstrating how the various elements come together to define the service. WSDL documents can be converted to code by various tools to generate client and service code for web services.