WSDL Definition Element

The <definition> element must be the root element of all WSDL documents. It defines the name of the web service.
Here is the example piece of code from last session which uses definition element.

<definitions name="HelloWorldService"


From the above example we can conclude the followings points:

  • The definitions element is a container of all the other elements.
  • The definitions element specifies that this document is the HelloWorldService.
  • The definitions element specifies a targetNamespace attribute. The targetNamespace is a convention of XML Schema that enables the WSDL document to refer to itself. In this example we have specified a targetNamespace of
  • The definition element specifies a default namespace: xmlns= All elements without a namespace prefix, such as message or portType, are therefore assumed to be part of the default WSDL namespace.
  • It also specifies numerous namespaces that will be used throughout the remainder of the document.

NOTE: The namespace specification does not require that the document actually exist at the given location. The important point is that you specify a value that is unique, different from all other namespaces that are defined.

Wikipedia for WSDL


<<Previous <<   || Index ||   >>Next >>