Writing the WSDL File
A WSDL document enables a SOAP client to retrieve complete information about the services, operations, and message types that are supported by a particular SOAP server. The full details of the WSDL file format would require an entire chapter or perhaps a whole book to discuss, but by examining a concrete example it's possible to become productive rather quickly.
A WSDL document serves as a contract between the client and server so that each understands what's expected of the other. Table 1 shows the types of SOAP entities that are exposed by the WSDL file.
Table 1 SOAP Entities Exposed in a WSDL Document.
Entity |
Explanation |
Service |
A named collection of related SOAP ports. |
Port |
The binding, port type, and physical URL that the client will use to transmit and receive SOAP requests for this service. |
Binding |
The concrete encoding details (preferred character encoding, message element names, and so on) for a given SOAP port. |
Port type |
The various operations that can be performed over a particular SOAP port. An operation is equivalent to a single method call on an object. |
Message |
The logical structure of the content being transferred back and forth in a given SOAP request. Messages are composed of parts, which map an XML element name to a specific datatype. |
Types |
The section where application-specific types can be declared for use in message declarations. Types are declared using XML Schema notation. |
The complete WSDL file for the OrderHandler service is located in OrderHandler.wsdl. It provides the declarations necessary to allow the Microsoft SOAP server to receive and process SOAP requests for the OrderHandler service. To complete the application setup, the WSDL and WSML files must be copied to the IIS virtual directory that was created previously. Then it's time to test the SOAP connection to make sure that the system is properly configured from end to end.