A note on wsdl and xsd imports – part II
Summary of WSDL 2.0 Solution
The following table provides a summary of the importing and including mechanisms in WSDL 2.0.
| Mechanism | Object | Meaning | Visibility of Schema Components |
|---|---|---|---|
| wsdl:import | WSDL 2.0 Namespace | Declare that WSDL 2.0 components refer to WSDL 2.0 components from a DIFFERENT targetNamespace. | XML Schema Components in the imported description are NOT visible to the containing description |
| wsdl:include | WSDL 2.0 Document | Merge Interface, Binding and Service components from another WSDL 2.0 document that has the SAME targetNamespace. | XML Schema components in the included description are visible to the containing description. |
| wsdl:types/ xs:import | XML Schema Namespace | Declare that XML Schema components refer to XML Schema components from a DIFFERENT targetNamespace. | XML Schema components in the imported namespace are visible to the containing description. |
| wsdl:types/ xs:schema/xs:import | XML Schema Namespace | Declare that XML Schema components refer to XML Schema components from a DIFFERENT targetNamespace. | XML Schema components in the imported namespace are NOT visible to the containing description |
| wsdl:types/ xs:schema/xs:include | XML Schema Document | Merge XML Schema components from another XML Schema document that has the SAME or NO targetNamespace. | XML Schema components in the included document are visible to the containing description. |
The Key Differences Between WS-I BP and WSDL 2.0 Solutions
WS-I solution described in A note on wsdl and xsd imports was based on WSDL1.1. It inherited the limitations of WSDL1.1 and sometimes had to rely on work-arounds to resolve a problem. W3C has more freedom for redesigning the architecture of WSDL. It aims to provide a more coherent solution in WSDL 2.0.
While the majority of the WSDL 2.0 solution is aligned with WS-I BP1.x, there are indeed at least two important differences:
- WSDL2.0 models more closely to XSD. It adds wsdl:include to allow merging wsdl components in same namespace from external files.
- WSDL2.0 allows use of xs:import directly under wsdl:types to bring schema components defined in external files into a WSDL description.
Where to Get More Details?
If the summary above is not sufficient for you, read the WSDL 2.0 primer, especially section 2.3 and section 3. These sections provide a detail explanation and many examples for the importing and including mechanisms.