W3C home > Mailing lists > Public > www-ws-desc@w3.org > March 2006

Re: Must XML schema elements by imported in WSDL 2.0?

From: Arthur Ryman <ryman@ca.ibm.com>
Date: Thu, 16 Mar 2006 12:58:30 -0500
To: www-ws-desc@w3.org
Message-ID: <OF7B0057FD.65776D84-ON85257133.00626CFD-85257133.0062BD8E@ca.ibm.com>
Roberto, I agree with your proposal.

I did an experiment with Xerces. Consider the following valid schema, 
test1.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://www.example.org/test1"
        xmlns:tns="http://www.example.org/test1">
 
        <import namespace="http://www.w3.org/2001/XMLSchema"></import>

        <complexType name="schemaType">
                <sequence>
                        <element ref="schema"></element>
                </sequence>
        </complexType>
</schema>

If I remove the <import> Xerces gives me the following error:

src-resolve.4.2: Error resolving component 'schema'. It was detected that 
'schema' is in namespace 'http://www.w3.org/2001/XMLSchema', but 
components from this namespace are not referenceable from schema document 
'file:///D:/workspaces/WSD/schematest/test1.xsd'. If this is the incorrect 
namespace, perhaps the prefix of 'schema' needs to be changed. If this is 
the correct namespace, then an appropriate 'import' tag should be added to 
'file:///D:/workspaces/WSD/schematest/test1.xsd'.

Therefore, to be consistent with XSD, we must require the <import> when 
refering to elements. In contrast, the following valid schema test2.xsd 
refers to a built-in simple type and there is no <import>

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://www.example.org/test2"
        xmlns:tns="http://www.example.org/test2">
 
        <complexType name="countType">
                <sequence>
                        <element name="count" type="int"></element>
                </sequence>
        </complexType>
</schema>

Arthur Ryman,
IBM Software Group, Rational Division

blog: http://ryman.eclipsedevelopersjournal.com/
phone: +1-905-413-3077, TL 969-3077
assistant: +1-905-413-2411, TL 969-2411
fax: +1-905-413-4920, TL 969-4920
mobile: +1-416-939-5063, text: 4169395063@fido.ca
Received on Thursday, 16 March 2006 17:58:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:58:39 GMT