WSDL sluży do opis parametrów serwisu ważnych dla klienta, szczegółów z których będzie musiał korzystać przy tworzeniu aplikacji korzystacjących z wybranego serwisu. Aby udostępnić swój serwis trzeba stworzyć dokument WSDL. Jest dokument XML zgodny z określonym schematem, który jest używany między innymi do generowania klas po stronie klienta serwisu. Definiuje też szczegóły jak połączyć się z danym serwisem.
The messages, operations, and port types are all abstract definitions, which means the definitions do not carry deployment-specific details to enable their reuse. WSDL specyfikuje opis serwisu w postaci endpointów zwanych portami. W takim dokumencie występuja 4 rodzaje elementów:
<definitions name="WeatherWebService" targetNamespace="urn:WeatherWebService" xmlns:tns="urn:WeatherWebService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> <types/> <message name="WeatherService_getWeather"> <part name="String_1" type="xsd:string"/> </message> <message name="WeatherService_getWeatherResponse"> <part name="result" type="xsd:string"/> </message> <portType name="WeatherService"> <operation name="getWeather" parameterOrder="String_1"> <input message="tns:WeatherService_getWeather"/> <output message="tns:WeatherService_getWeatherResponse"/> </operation> </portType> <binding name="WeatherServiceBinding" type="tns:WeatherService"> <operation name="getWeather"> <input> <soap:body use="literal" namespace="urn:WeatherWebService"/> </input> <output> <soap:body use="literal" namespace="urn:WeatherWebService"/> </output> <soap:operation soapAction=""/></operation> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/> </binding> <service name="WeatherWebService"> <port name="WeatherServicePort" binding="tns:WeatherServiceBinding"> <soap:address location="http://mycompany.com/weatherservice"/> </port> </service> </definitions>
; Znaczenie poszczególnych elementów: