14.11. What is WSDL?While SOAP is used as the format of the exchanged message, WSDL is used to describe the callable web service. WSDL is the XML vocabulary for describing web services, where they are located, and how they can be called. Using the WSDL description of a web service, we can code a client typically with at least some code generation to reduce the amount of hand coding that must be done. WSDL documents describe the what, how, and where of web services, as illustrated in the simplified WSDL document shown in Figure 14-8. First, consider the what. A port type describes the abstract interface, which is the web service to be called. A port type can have one or more operations. An operation describes the functionality to be called, and the input, output, and fault message types associated with it. The different messages are built from built-in or custom data types. The data types themselves are defined using the XSD language. To describe how to call a web service, a binding specifies the transport protocol for exchanging messages, such as HTTP, HTTPS, SMTP, FTP, and so on. The service can be bound to multiple protocols if the service provider can accept them. Finally, a WSDL port details the specific network address at which the service can be found. Example 14-2 shows an actual WSDL document for a GetAddress function. Figure 14-8. A simplified WSDL documentExample 14-2. A WSDL file
The WSDL file describes the web service: how to format the messages that will be exchanged to implement the service and the network location for accessing the service. |