02 - WSDL 2.0 Elements

WSDL files are XML files that describe the interface of a web service. It contains the following elements:

  • description: this element is the root of any WSDL 2.0 file, any other WSDL element will be nested within this element
  • types: this element contains a specification of the data types that are to be exchanged between the provider of the service and the consumer.
  • interface: this element describes the operations available in the web service and what messages should be exchanged between the provider and the consumer for each operation (request / response). This element is also used for describing any possible fault message.
  • binding: this element describes how you can access the service over the network. This is usually binding the web service to the HTTP protocol.
  • service: this element describes where the service can be accessed over the network, it usually contains an URL leading to the service.
  • documentation: this element is optional and provides a humanly readable description of the web service.
  • import: this element is optional. It is used for importing XML schemas or even other WSDL files.

The following is a basic example of a WSDL file with all the required elements:

<description>
  <types>
  </types>
  <interface>
  </interface>
  <binding>
  </binding>
  <service>
  </service>
</description>

 

Like us on Facebook