Re: Semantics of wsdl:import

Hi Menon, 

in WSDL 1.1, AFAIK, it was common practice to import schemas using
wsdl:import, even use this to import schemas from within WSDL files. I
don't know how the Basic Profile regulates this, if at all; from the
point of view of common practice, the code snippet below is correct.

WSDL 2.0 talks about importing schemas in the section on types (section
3), and in section 4.2.2 it says that wsdl:import location attribute
gives a hint about where a WSDL 2.0 document can be found for this
import. So I believe WSDL 2.0 is clear enough about how the various
imports are to be done. 

There may be a problem that for people coming from WSDL 1.1, this
information is not spelled out clearly enough; this may be an editorial
issue which the WG could consider.

Best regards,

Jacek

On Tue, 2006-02-14 at 16:50 +0530, Ramkumar Menon wrote:
> Hi Jacek,
> 
> Thanks ! I completely agree with you.
> I knew this point, but I have seen folks specify schemas as top level
> imports, which is incorrect, but is pardoned by most API
> representations for WSDL, like JSR 110.[WSDL4J] 
> 
> After the User models a top level XSD import, he could go ahead and
> treat the imported artifact as a blackbox and treat it the way he/she
> wishes to.
> Let me take the freedom of adding a code snippet of an incorrect usage
> of imports in a JSR 110 implementation. 
> List imports = definition.getImports();
> Import importedXSD = (Import)imports.get(0);
> String xsdLocation = importedXSD.getLocationURI();
> //use W3C  DOM APIs to parse the XSD and retrieve the information.
> Document xsdDoc = domParser.parse(new InputStream(xsdLocation));
> This is obviously a hackish way to bypass the specification.
> There are two options.
> 1) Explicitly have a mention in the specification that <wsdl:import>
> can only be used to import WSDL descriptions, and is an error
> otherwise.
> 2) The plain vanilla attribute name "location" on the <import> could
> possibly be misleading -it does not indicate what all can be imported
> into the wsdl description. Need to think of an alternative to this
> attribute naming- lets say "wsdlLocation". 
> 
> rgds,
> Menon

Received on Tuesday, 14 February 2006 11:33:59 UTC