RE: Can one inline schema import definitions from a second inli ne schema?

Umit,
 
From my recollection of the discussion in the WS-I group, the case where the
two schemas are in the same WSDL document was not brought up to consider. So
I don't think R2004 was designed with he intend to prevent this. It was
written with the intent to prevent importing a schema that is inlined in
another WSDL document. I agree that the current wording in the profile has
the effect of forbidding it even if it is the same WSDL document but I don't
think this was intentional. The WS-I BP group hasn't taken an explicit
position one way or the other on this and now that Jonathan has brought it
up in WS-I the BP group should be free to create an errata if it decides
that importing between schemas defined in the same WSDL doc is OK. Which I
think should be the case.
 
William
 

-----Original Message-----
From: www-ws-desc-request@w3.org [mailto:www-ws-desc-request@w3.org] On
Behalf Of Umit Yalcinalp
Sent: Wednesday, October 22, 2003 6:36 PM
To: Jonathan Marsh
Cc: www-ws-desc@w3.org
Subject: Re: Can one inline schema import definitions from a second inline
schema?




Jonathan Marsh wrote:


I've raised a question on the intent of R2004 in the BP - I had assumed it
was focused on ensuring the right version of Schema was used, and it may be
that disallowing imports between multiple inline schemas is an unintended
side-effect of the language.


My BP resources indicate that the intention was to disallow importing of an
inlined schema from a WSDL document. This definitely covers disallowing
imports between inline schemas because the importing document is WSDL and
the schema imported is inlined in a WSDL document (whose document root is
not schema). In this specific case (just like the base method of a recursive
function call :-)), the WSDL documents happen to be the same. Therefore, I
conclude that this case is completely forbidden R2004. 


--umit









  _____  


From: www-ws-desc-request@w3.org <mailto:www-ws-desc-request@w3.org>
[mailto:www-ws-desc-request@w3.org <mailto:www-ws-desc-request@w3.org> ] On
Behalf Of Anne Thomas Manes
Sent: Saturday, October 18, 2003 5:46 AM
To: Martin Gudgin; www-ws-desc@w3.org <mailto:www-ws-desc@w3.org> 
Subject: RE: Can one inline schema import definitions from a second inline
schema?



Regarding xs:import location pointing to a file with <schema> root element:

I don't believe that the schema spec requires that, but the WS-I BP does.
R2004:


5.1.2 WSDL and Schema Import


Some examples in WSDL 1.1 incorrectly show the WSDL import statement being
used to import XML Schema definitions. The Profile clarifies use of the
import mechanisms to keep them consistent and confined to their respective
domains. Imported schema documents are also constrained by XML version and
encoding requirements consistent to those of the importing WSDL documents. 

r2001R2001 A DESCRIPTION MUST only use the WSDL "import" statement to import
another WSDL description. 

r2002R2002 To import XML Schema Definitions, a DESCRIPTION MUST use the XML
Schema "import" statement. 

r2003R2003 A DESCRIPTION MUST use the XML Schema "import" statement only
within the xsd:schema element of the types section. 

r2004R2004 A DESCRIPTION MUST NOT use the XML Schema "import" statement to
import a Schema from any document whose root element is not "schema" from
the namespace "http://www.w3.org/2001/XMLSchema
<http://www.w3.org/2001/XMLSchema> ". 

Anne

At 06:10 AM 10/18/2003, you wrote:






> -----Original Message-----
> From: Lawrence Mandel [mailto:lmandel@ca.ibm.com
<mailto:lmandel@ca.ibm.com> ] 
> Sent: 17 October 2003 19:08
> To: Amelia A. Lewis
> Cc: Arthur Ryman; Martin Gudgin; paul.downey@bt.com
<mailto:paul.downey@bt.com> ; 
> sanjiva@watson.ibm.com; www-ws-desc@w3.org <mailto:www-ws-desc@w3.org> ;
www-ws-desc-request@w3.org <mailto:www-ws-desc-request@w3.org> 
> Subject: Re: Can one inline schema import definitions from a 
> second inline schema?
> 
> 
> 
> 
> 
> I agree that using the schema language as intended is the best option.
> However, the xs:import element was not designed with the idea 
> of importing a schema that is located in the same physical 
> file as the schema that is importing it. Existing schema 
> processors do not know how to resolve inline schemas by 
> default and will have to be configured to do so. 

Why? If I were a WSDL processor, I'd just load up my favorite schema
processor and pass it the two schema elements.


> Not 
> clarifying the correct way to import an inline schema will 
> result in different takes on how to import an inline schema. 

XML Schema already deals with this by allowing xs:import with no
schemaLocation.

> This is a potential interoperability problem that can be 
> addressed at the WSDL specification level (rather then 
> leaving this for the WS-I Basic Profile). If this is not 
> clarified, what will it mean if someone has an import 
> statement such as
> 
> <xs:import namespace="http://mynamespace" <http://mynamespace>  
> schemaLocation="mywsdl.wsdl"/>

I seem to remember the schema spec saying something about a
schemaLocation resolving to something with <xs:schema> as its top-level
element. Anyone else have a similar recollection?

> 
> Will that resolve http://mynamespace <http://mynamespace/>  to another
inline 
> schema? Will the following be valid?
> 
> <xs:import namespace="http://mynamespace" <http://mynamespace> 
> schemaLocation="http://mynamespace <http://mynamespace/> "/>

A schema processor is at liberty to ignore schemaLocation on import, so
this could resolve locally.

> 
> Or is the correct way
> 
> <xs:import namespace="http://mynamespace <http://mynamespace/> "/>

All the above are legal. Only the latter would resolve to 'a schema the
schema processor got by some unknown mechanism' ( i.e. another inline
schema )

> 
> I tend to think that not including a schemaLocation is the 
> correct way but there is currently nothing that will prevent 
> others from using one of the other two import statements.  
> Because WSDL is using XML Schema in a way that it was not 
> intended to be used 

Who says? I think this was absolutely one of the ways schema was
intended to be used.

> the WSDL specification should make 
> clarifications to XML Schema where needed.
> 
> Alternatively, if the goal is to use XML Schema as it was 
> designed, 

XML Schema was designed to allow a schema processor to construct a
schema in any way it saw fit. External documents, element nodes from a
DOM etc.

> inline schemas should not be allowed at all and all 
> schemas should be defined in external documents and imported 
> into WSDL documents. This approach will maintain the 
> independence and integrity of XML Schema and reduce the 
> amount of clarifications the WSDL specification needs to make 
> as a result of using XML Schema internally in WSDL documents.

I'm still not convinced any such clarification is necessary

Gudge

> 
> Comments?
> 
> Lawrence Mandel
> 
> Software Developer
> WebSphere Studio Application Developer - XML Tools
> Phone: 905 - 413 - 3814   Fax: 905 - 413 - 4920
> lmandel@ca.ibm.com
> 
> 
>                                                               
>              
>              "Amelia A. Lewis"                                
>              
>              <alewis@tibco.com <mailto:alewis@tibco.com>

>              
>              >                                                
>           To 
>                                        paul.downey@bt.com
<mailto:paul.downey@bt.com>      
>              
>              10/17/2003 12:03                                 
>           cc 
>              PM                        mgudgin@microsoft.com
<mailto:mgudgin@microsoft.com> , 
>              
>                                        
> sanjiva@watson.ibm.com, Arthur      
>                                        
> Ryman/Toronto/IBM@IBMCA, Lawrence   
>                                        
> Mandel/Toronto/IBM@IBMCA,           
>                                        www-ws-desc@w3.org
<mailto:www-ws-desc@w3.org> ,    
>              
>                                        
> www-ws-desc-request@w3.org <mailto:www-ws-desc-request@w3.org>           
>                                                               
>      Subject 
>                                        Re: Can one inline 
> schema import    
>                                        definitions from a 
> second inline    
>                                        schema?                
>              
>                                                               
>              
>                                                               
>              
>                                                               
>              
>                                                               
>              
>                                                               
>              
>                                                               
>              
> 
> 
> 
> 
> Do we need to do so?
> 
> The current language of the specification seems fairly 
> straightforward.
> We permit, as immediate children of types, when W3C XML 
> Schema is used (and it is the only schema language required 
> to be supported by all WSDL processors), both xs:schema and 
> xs:import.  We *do not* constrain the semantics of these 
> child elements, except to change @targetNamespace to REQUIRED 
> (for embedded and imported schemata both).
> 
> We should not, in my opinion, overconstrain W3C XML Schema.  
> We have already forbidden the use of chameleon schemata, 
> which removes an enormous burden on processors; support for 
> that [mis?]feature would have placed an unacceptable burden 
> on the WSDL processor, since we would have had to define the 
> semantics of chameleon schemata in a context never 
> anticipated (the idea that a WSDL targetNamespace could apply 
> to an imported/embedded schema makes for all sorts of really 
> interesting and sometimes quite surprising interactions).
> 
> In so far as is possible, we should *not* change semantics of 
> W3C XML Schema, in my opinion.  The value of requiring it as 
> a supported schema language lies in the re-use of existing 
> schema processors.  If we begin to place further constraints 
> upon it, it stops being the language supported by existing 
> processors, and requires a whole new generation of processors 
> customized for schema-in-WSDL-context.
> 
> The idea behind embedding and importing schema, as I 
> understand it, is to rule that whole complex area *out of 
> scope* for the WSD WG.  Writing a schema language is *hard*, 
> we need to reuse, not reinvent, and not revise.  This allows 
> us to focus on what we [should?] do best.
> 
> Amy!
> On Fri, 17 Oct 2003 16:39:32 +0100
> paul.downey@bt.com <mailto:paul.downey@bt.com>  wrote:
> 
> >
> > isn't this an issue about how multiple inline schemas reference each
> > other in a   single WSDL document ?
> >
> > AIUI it's just a matter of formally stating what appears to be a 
> > common practice.
> >
> > Paul
> >
> > -----Original Message-----
> > From: Martin Gudgin [mailto:mgudgin@microsoft.com
<mailto:mgudgin@microsoft.com> ]
> > Sent: 17 October 2003 16:36
> > To: Downey,PS,Paul,XSJ67A C; sanjiva@watson.ibm.com; 
> ryman@ca.ibm.com
> > Cc: lmandel@ca.ibm.com; www-ws-desc@w3.org <mailto:www-ws-desc@w3.org> ;

> www-ws-desc-request@w3.org <mailto:www-ws-desc-request@w3.org> 
> > Subject: RE: Can one inline schema import definitions from a second 
> > inline schema?
> >
> >
> > Given that xs:import is defined by XML Schema and NOT WSDL, I don't 
> > see how WSDL can really constrain it in any way.
> >
> > Gudge
> >
> > > -----Original Message-----
> > > From: paul.downey@bt.com <mailto:paul.downey@bt.com>
[mailto:paul.downey@bt.com <mailto:paul.downey@bt.com> ]
> > > Sent: 17 October 2003 16:35
> > > To: sanjiva@watson.ibm.com; Martin Gudgin; ryman@ca.ibm.com
> > > Cc: lmandel@ca.ibm.com; www-ws-desc@w3.org <mailto:www-ws-desc@w3.org>
; 
> > > www-ws-desc-request@w3.org <mailto:www-ws-desc-request@w3.org>
Subject: RE: Can one inline 
> schema import 
> > > definitions from a second inline schema?
> > >
> > > i don't think the BP doesn't preclude more than 1 schema 
> within the 
> > > types section - though i couldn't see anything about referencing 
> > > between inline schemas.
> > >
> > > FWIW, quite a few existing kits (including .NET) will 
> generate WSDL 
> > > 1.1 with multiple inline schemas which reference each other using 
> > > <import namespace="blah"> - with a missing schemaLocation ..
> > >
> > > maybe the anonymous schemaLocation should be supported/precluded 
> > > explicitly in WSDL 1.2 ?
> > >
> > >
> > > --
> > > Paul Sumner Downey
> > > Web Services Integration
> > > BT Exact
> > >
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Sanjiva Weerawarana [mailto:sanjiva@watson.ibm.com
<mailto:sanjiva@watson.ibm.com> ]
> > > Sent: 17 October 2003 16:02
> > > To: Martin Gudgin; Arthur Ryman
> > > Cc: Lawrence Mandel; www-ws-desc@w3.org <mailto:www-ws-desc@w3.org> ; 
> www-ws-desc-request@w3.org <mailto:www-ws-desc-request@w3.org> 
> > > Subject: Re: Can one inline schema import definitions 
> from a second 
> > > inline schema?
> > >
> > >
> > >
> > > Didn't we discuss this a while back and say only *1* 
> schema within 
> > > <types>?? Or maybe that WSI BP that does that?
> > >
> > > Sanjiva.
> > >
> > > ----- Original Message -----
> > > From: "Arthur Ryman" <ryman@ca.ibm.com>
> > > To: "Martin Gudgin"  <mailto:mgudgin@microsoft.com>
<mgudgin@microsoft.com>
> > > Cc: "Lawrence Mandel" <lmandel@ca.ibm.com>; <www-ws-desc@w3.org
<mailto:www-ws-desc@w3.org> >; 
> > >  <mailto:www-ws-desc-request@w3.org> <www-ws-desc-request@w3.org>
> > > Sent: Friday, October 17, 2003 7:56 PM
> > > Subject: RE: Can one inline schema import definitions 
> from a second 
> > > inline schema?
> > >
> > >
> > > > Gudge,
> > > >
> > > > I agree to some extent, but AFAIK, WSDL is the only application 
> > > > that inlines <schema>. I think the XSD spec assumes you have a
> > > single <schema>
> > > > per document, i.e. <schema> is the root element. So
> > > processing not one,
> > > > but two or more inline schemas is a bit of a shock for your
> > > typical XSD
> > > > processor. So probably the "reasonable" behavior you 
> describe is 
> > > > undefined.
> > > >
> > > > I think it would promote interoperability if the WSDL 1.2
> > > was clear on
> > > > this point, one way or the other. From your response, I
> > > assume you would
> > > > support the use of more than one inline <schema> in the
> > > <types> element.
> > > >
> > > > Arthur Ryman
> > > >
> > > >
> > > >
> > > >
> > > > "Martin Gudgin"  <mailto:mgudgin@microsoft.com>
<mgudgin@microsoft.com> Sent by: 
> > > > www-ws-desc-request@w3.org <mailto:www-ws-desc-request@w3.org> 
> > > > 10/17/2003 06:17 AM
> > > >
> > > >
> > > >         To:     Lawrence Mandel/Toronto/IBM@IBMCA,
> > > <www-ws-desc@w3.org <mailto:www-ws-desc@w3.org> >
> > > >         cc:
> > > >         Subject:        RE: Can one inline schema import
> > > definitions from
> > > a second inline schema?
> > > >
> > > >
> > > >
> > > >
> > > > To be frank, I think this has very little to do with 
> WSDL. It is 
> > > > perfectly coherent for a schema processor, on encountering
> > > <xsd:import
> > > > namespace='http://namespace1 <http://namespace1> ' /> to say to
itself, ah, I
> > > have a schema
> > > > for that namespace, I'll use that here. Likewise, when it 
> > > > encounters<xsd:import namespace='http://namespace2
<http://namespace2/> ' /> it would 
> > > > say,
> > > ah, not seen
> > > > that namespace yet, I'll wait and see what happens.
> > > >
> > > > Gudge
> > > >
> > > > > -----Original Message-----
> > > > > From: www-ws-desc-request@w3.org
<mailto:www-ws-desc-request@w3.org>  
> > > > > [mailto:www-ws-desc-request@w3.org
<mailto:www-ws-desc-request@w3.org> ] On Behalf Of 
> Lawrence Mandel
> > > > > Sent: 16 October 2003 23:19
> > > > > To: www-ws-desc@w3.org <mailto:www-ws-desc@w3.org> 
> > > > > Subject: Can one inline schema import definitions 
> from a second 
> > > > > inline schema?
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Hello,
> > > > >
> > > > > We have customers that do the following in WSDL 1.1:
> > > > >
> > > > > <types>
> > > > >  <schema targetNamespace="http://namespace1" <http://namespace1>
xmlns= 
> > > > > "http://www.w3.org/2001/XMLSchema
<http://www.w3.org/2001/XMLSchema> "
> > > > > xmlns:two="http://namespace2 <http://namespace2/> ">
> > > > >    <import namespace="http://namespace2 <http://namespace2/> "/>
> > > > >    <complexType name="myComplexType">
> > > > >     <sequence>
> > > > >      <element name="myElement" type="two:B"/>
> > > > >     </sequence>
> > > > >    </complexType>
> > > > >    <complexType name="A">
> > > > >     <sequence>
> > > > >      <element name="elementA" type="xsd:string"/>
> > > > >     </sequence>
> > > > >    </complexType>
> > > > >   </schema>
> > > > >   <schema targetNamespace="http://namespace2 <http://namespace2/>
" xmlns= 
> > > > > "http://www.w3.org/2001/XMLSchema
<http://www.w3.org/2001/XMLSchema> "
> > > > > xmlns:one="http://namespace1 <http://namespace1/> ">
> > > > >    <import namespace="http://namespace1 <http://namespace1/> "/>
> > > > >    <complexType name="myComplexType">
> > > > >     <sequence>
> > > > >      <element name="myElement" type="one:A"/>
> > > > >     </sequence>
> > > > >    </complexType>
> > > > >    <complexType name="B">
> > > > >     <sequence>
> > > > >      <element name="elementB" type="xsd:string"/>
> > > > >     </sequence>
> > > > >    </complexType>
> > > > >   </schema>
> > > > > </types>
> > > > >
> > > > > The customers say that this is not explicitly 
> forbidden by the 
> > > > > WSDL 1.1 specification and I can't find anything that forbids 
> > > > > this in the WSDL 1.1 specification.  However, there 
> is nothing 
> > > > > in the WSDL 1.1 specification that states how to 
> import a schema 
> > > > > defined in the same types section but with a different 
> > > > > namespace.
> > > > >
> > > > > Is this allowed according to the WSDL 1.2 
> specification?  If so, 
> > > > > what is the correct way to import one inline schema
> > > into another?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Lawrence Mandel
> > > > >
> > > > > Software Developer
> > > > > WebSphere Studio Application Developer - XML Tools
> > > > > Phone: 905 - 413 - 3814   Fax: 905 - 413 - 4920
> > > > > lmandel@ca.ibm.com
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> 
> 
> --
> Amelia A. Lewis
> Architect, TIBCO/Extensibility, Inc.
> alewis@tibco.com <mailto:alewis@tibco.com> 
> 
> 
> 
> 



-- 

Umit Yalcinalp                                  

Consulting Member of Technical Staff

ORACLE

Phone: +1 650 607 6154                          

Email: umit.yalcinalp@oracle.com <mailto:umit.yalcinalp@oracle.com> 

Received on Wednesday, 22 October 2003 21:45:04 UTC