Stylus Studio XML Editor

Table of contents

Appendices

4.2 Importing Descriptions

Importing Descriptions
<definitions>
  <import
        namespace="xs:anyURI" 
        location="xs:anyURI"? >
    <documentation />?
  </import>
</definitions>

The WSDL import element information item, like the include element information item (see [Including Descriptions]) also allows for the separation of the different components of a WSDL description into independent descriptions, but in this case with different target namespaces, which can be imported as needed. This technique helps writing clearer WSDL descriptions by separating the definitions according to their level of abstraction, and maximizes reusability.

The WSDL import element information item is modeled after the XML Schema import element information item (see [XMLSchemaP1], section 4.2.3 "References to schema components across namespaces"). Specifically, it can be used to import components from WSDL descriptions that do not share a target namespace with the importing document. Components in directly imported descriptions are part of the component model of the importing description. Directly imported means that component importation is not transitive; components imported by one of the imported documents are not available to the original importing document unless the are imported directly by that document. The imported components can be referenced by QName.

Using the import construct is a necessary condition for making components from another namespace available to a WSDL description. That is, a WSDL description MUST NOT refer to components in a namespace other than the target namespace unless an import statement for that namespace is present. The same considerations apply to schemas embedded in an imported WSDL description (see [Embedding XML Schema]). More explicitly, components defined by an XML schema document embedded inside an imported WSDL description are NOT made available to the importer unless the latter contains an explicit xs:import statement to that purpose.

This specification DOES NOT preclude repeating the import element information item for the same value of the namespace attribute information item as long as they provide different values for the location attribute information item. Repeating the import element information item for the same namespace value MAY be used as a way to provide alternate locations to find information about a given namespace.

Furthermore, this specification DOES NOT require the location attribute information item to be dereferenceable. If it is not dereferenceable then no information about the imported namespace is provided by that import element information item. It is possible that such lack of information results in QNames in other parts of a WSDL Definitions component to become broken references (see [QName resolution]). Such broken references are not errors of the imports element information item but rather QName resolution errors which must be detected as described in [QName resolution].

The import element information item has the following Infoset properties:

  • A [local name] of import.

  • A [namespace name] of http://www.w3.org/2004/08/wsdl.

  • Two or more attribute information items amongst its [attributes] as follows:

    • A REQUIRED namespace attribute information item as described below in [ ].

    • An OPTIONAL location attribute information item as described below in [ ].

    • Zero or more namespace qualified attribute information items. The [namespace name] of such attribute information items MUST NOT be http://www.w3.org/2004/08/wsdl.

  • Zero or more element information item amongst its [children], as follows:

    • An optional documentation element information item (see [Documentation]).

    • Zero or more namespace-qualified element information items amongst its [children]. The [namespace name] of such element information items MUST NOT be http://www.w3.org/2004/08/wsdl.

namespace attribute information item[top]

namespace attribute information item

The namespace attribute information item has the following Infoset properties:

  • A [local name] of namespace.

  • A [namespace name] which has no value.

The namespace attribute information item is of type xs:anyURI. Its actual value indicates that the containing WSDL document MAY contain qualified references to WSDL definitions in that namespace (via one or more prefixes declared with namespace declarations in the normal way). This value MUST NOT match the actual value of the enclosing WSDL document targetNamespace attribute information item. If the import statement results in the import of a WSDL document then the actual value of the namespace attribute information item MUST be identical to the actual value of the imported WSDL document's targetNamespace attribute information item.

location attribute information item with import [owner][top]

location attribute information item with import [owner]

The location attribute information item has the following Infoset properties:

  • A [local name] of location.

  • A [namespace name] which has no value.

The location attribute information item is of type xs:anyURI. Its actual value is the location of some information about the namespace identified by the namespace attribute information item.

The location attribute information item is optional. This allows WSDL components to be constructed from information other than serialized XML 1.0. It also allows the development of WSDL processors that have a priori (i.e., built-in) knowledge of certain namespaces.