XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] What is the diff between "import" vs "include" ?

Uh.

On Tue, 15 Apr 2008 17:27:43 -0400
Jonathan Robie <jonathan.robie@redhat.com> wrote:
>Ben Stover wrote:
>> In a WSDL definition I saw an "import" af and *.xsd file and an
>> "include" of an *.xsd schema.

This is, presumably, WSDL 2.0.  WSDL 1.1 does not have an inclusion
mechanism (W3C XML Schema does, but within a <schema> element in the
<types> section, W3C XML Schema rules control (except when they don't;
welcome to the wonderful world of WSDL)).

>> what is the difference?

In WSDL 2.0, only WSDL documents may be included or imported using
wsdl:import and wsdl:include.

In WSDL 1.1, only wsdl:import is defined, but it may import both W3C XML
Schema and WSDL (1.1).  Note, however, that it can't if you're using WS-I
rules, which say that you shouldn't use wsdl:import to import a schema,
but should use <xs:import> inside a <schema> inside <types>,
notwithstanding that an import is conceptually *not* a re-export so that
the so-imported elements ought *not* be visible to the WSDL (by purist
standards, which WS-I is not, and which most implementations aren't,
either).  An xs:include inside an xs:schema inside wsdl:types should have
the effect of inclusion, with the restriction that chameleon includes are
not permitted (yes, WSDL 1.1 redefines the semantics of schema when that
schema is inlined into a WSDL).

Umm.  TMI?  Also, check your implementation.  They differ, sometimes
significantly.  Within an implementation, if WS-I compliance is optional,
the implementation may differ from itself in different modes.  All of
this is getting better (and WSDL 2.0 addresses most of this, but nobody
has an implementation, to speak of), in the sense that there's
increasingly less variance.  Check your implementation is the best rule,
still.

>With include, everything that is included must be in the including 
>schema's target namespace.  Import lets you pull in definitions and 
>declarations from other namespaces.
>
>See:
>http://www.w3.org/TR/xmlschema-0/#SchemaInMultDocs
>http://www.w3.org/TR/xmlschema-0/#import

Jonathan, this is at least misleading, since the OP specified schema
import and include inside WSDL, with no mention of where, or which
version.  This is ... difficult, since there is no wsdl:include in 1.1,
and wsdl:include can't include schema in 2.0.  It's true for schema
alone, but schema inside WSDL may not behave as expected.

Amy!
-- 
Amelia A. Lewis                    amyzing {at} talsever.com
  Light is the left hand of darkness
  and darkness the right hand of light.
    Two are one, life and death, lying
    together like lovers in kemmer,
      like hands joined together,
      like the end and the way.
        -- Tormer's Lay [Ursula K. Le Guin, "The Left Hand of Darkness"]


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS