W3C home > Mailing lists > Public > www-ws-desc@w3.org > July 2005

Re: Whoops - Example is invalid upate attached

From: Arthur Ryman <ryman@ca.ibm.com>
Date: Wed, 20 Jul 2005 18:11:59 -0400
To: "RDBMS" <RDBMS@aol.com>, www-ws-desc@w3.org
Cc: "Booth, David \(HP Software - Boston\)" <dbooth@hp.com>
Message-ID: <OF37F7D6F9.0A7C7B3F-ON85257044.00798CF6-85257044.0079EF63@ca.ibm.com>
James,

Thx for the example.

You are misinterpretting the spec. Your WSDL only references one 
namespace, http://www.testA.com:

        <message name="GetElementA">
                <part name="body" element="A:RootElementFromA" />
        </message>

Therefore you only need to import namespace A:

        <xs:import namespace="http://www.testA.com" 
schemaLocation="SchemaA.xsd"/>

The fact that the element A:RootElementFromA references B and C is 
irrelevant. The WSDL just references namespace http://www.testA.com so 
that's all you need to import.

Arthur Ryman,
Rational Desktop Tools Development

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
intranet: http://labweb.torolab.ibm.com/DRY6/



"RDBMS" <RDBMS@aol.com> 
07/20/2005 04:51 PM
Please respond to
"RDBMS"


To
"Booth, David \(HP Software - Boston\)" <dbooth@hp.com>
cc
Arthur Ryman/Toronto/IBM@IBMCA
Subject
Re: Whoops - Example is invalid  upate attached






Hi David, Arthur,

I thought that I would give it one more try ;-)

Attached are two examples (although WSDL 1.0/1.1 - sorry). Not elegant, 
but
something I could throw together quickly.

The WSDL with name terminating in "1" is what I would like to do with WSDL
2.0.  Note that in the <types/>, I import a single top-level schema for
SchemaA.xsd.

I do not declare additional imports for SchemaB.xsd or SchemaC.xsd. They 
are
already declared intrinsic to my schema hierarchy.

Note that I reference the entire message context of SchemaA in my WSDL and
generate a corresponding SOAP request, even though much of that context is
derived through the schema hierarchy (xs:import of SchemaB and SchemaC).

This is slightly different than David has asked for, but reflects a 
scenario
I run into often. Think of it as an over-simplified "doc/literal" example
;-)

The WSDL with the name terminating in "2" is what I have interpreted that 
I
must do with WSDL 2.0.  I must redeclare xs:imports for schemas B and C,
because according to the text from the draft, the subordinate xs:imports 
in
my schema hierarchy are "not available to WSDL".

If this is the case, it is not just a simple duplicate declaration.  I 
also
have to navigate my schema hierarchy to determine what all those nested
imports might be, expose my schema structure to WSDL - even though it is
already defined by my schema hierarchy, and I now statically define a 
second
representation of the hierarchy. If something in that schema hierarchy
changes later, I have to duplicate the maintenance effort.

Does this help ?

Thanks again !

J. Bean
P.O. Box 30171
Phoenix, AZ  85046-0171

RDBMS@aol.com
XML-Guy@hotmail.com
----- Original Message ----- 
From: "Booth, David (HP Software - Boston)" <dbooth@hp.com>
To: "RDBMS" <RDBMS@aol.com>
Cc: "Arthur Ryman" <ryman@ca.ibm.com>
Sent: Wednesday, July 20, 2005 11:20 AM
Subject: RE: Whoops - Example is invalid upate attached


James,

Your latest example still lacks a direct reference from something in
targetNamespace http://www.testA.com to something that was defined in
targetNamespace http://www.testC.com.  It only directly references
something that was defined in targetNamespace http://www.testB.com.

Try the following modification of your example instead.  Note that the
definition of RootElement2FromA attempts to reference C:ElementFromC,
though the C namespace was not xs:imported.


-------------- SchemaA.xsd --------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   elementFormDefault="qualified"
   attributeFormDefault="unqualified"
   targetNamespace="http://www.testA.com"
   xmlns="http://www.testA.com"
   xmlns:B="http://www.testB.com"
   xmlns:C="http://www.testC.com">

 <!--  Note that the import below ONLY imports schema "B". Schema "C" is
imported by declaration from wityhin schema "B", so you will not see it
here  -->
 <xs:import namespace="http://www.testB.com"
schemaLocation="SchemaB.xsd"/>

 <!--  The complexType below references a global declaration that is
defined in schema B  -->
 <xs:element name="RootElementFromA">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="B:ElementFromB" minOccurs="1"/>
   </xs:sequence>
  </xs:complexType>
 </xs:element>

 <!--  The complexType below attempts to reference a global declaration
that is defined in schema C.  However, the targetNamespace for C,
http://www.testC.com , was not xs:imported.  -->
 <xs:element name="RootElement2FromA">
  <xs:complexType>
   <xs:sequence>
    <xs:element ref="C:ElementFromC" minOccurs="1"/>
   </xs:sequence>
  </xs:complexType>
 </xs:element>
</xs:schema>

------------------------ SchemaB.xsd -------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            targetNamespace="http://www.testB.com"
            xmlns="http://www.testB.com"
            xmlns:C="http://www.testC.com">

    <!--  Note that the import below ONLY imports schema "C". Schema
"C" is not declared or defined as an xs:import to the top-level schema
SchemaA  -->
    <xs:import namespace="http://www.testC.com"
schemaLocation="SchemaC.xsd"/>

    <!--  Note that the element below "declares" a global element.
It is "referenced" from SchemaA  -->
    <xs:element name="ElementFromB">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="ElementFromB-2"/>
                <xs:element ref="C:ElementFromC"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="ElementFromB-2"/>

</xs:schema>

----------------------- SchemaC.xsd -----------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            targetNamespace="http://www.testC.com"
            xmlns="http://www.testC.com">

    <!--  Note that the element below "declares" a global element.
It is "referenced" from SchemaB, and by inheritance/import will be in
the instance as part of A  -->
    <xs:element name="ElementFromC" type="TypeT"/>

    <xs:simpleType name="TypeT">
        <xs:restriction base="xs:integer">
        <xs:enumeration value="1"/>
        <xs:enumeration value="2"/>
        </xs:restriction>
    </xs:simpleType>

</xs:schema>


-----Original Message-----
From: RDBMS [mailto:RDBMS@aol.com]
Sent: Wednesday, July 20, 2005 8:14 AM
To: Arthur Ryman
Cc: Booth, David (HP Software - Boston)
Subject: Re: Whoops - Example is invalid upate attached


Hi Arthur, David,

Here is another example that might be better. It validates with msxml4
and with XML Spy.

In this case, the hierarchy is A -> B -> C

The instance document will represent structure and containers that are
declared from all 3 schemas.

Yet, SchemaA (top-level) only imports SchemaB.  It does not import
SchemaC.

SchemaB imports SchemaC.

Sorry about the validation error (again). Proves that haste can cause
problems ;-)

Although very simple and a single branch, this example is more
representative of the schema reuse and assembly scenario I run into
quite a lot. You could extend this simple model horizontally and
vertically with additional imports.

Also, and if I am still interpreting the WSDL draft correctly, it
requires that I have to declare imports for all 3 schemas in <types/>,
rather than just SchemaA.

Thanks again,
J. Bean
P.O. Box 30171
Phoenix, AZ  85046-0171

RDBMS@aol.com
XML-Guy@hotmail.com
----- Original Message ----- 
From: Arthur Ryman
To: RDBMS
Cc: Booth, David (HP Software - Boston) ; www-ws-desc@w3.org
Sent: Tuesday, July 19, 2005 9:32 PM
Subject: Re: Whoops - Example is invalid upate attached



James,

Ignore, my comments below. After looking closer, I now see you wanted me
to look at SchemaA.xsd, not the instance document.  It says:

        <!--  Note that the import below ONLY imports schema "B". Schema
"C" is imported by declaration from wityhin schema "B", so you will not
see it here  -->

The following reference is invalid:

                                <xs:element ref="C:ElementFromC"
minOccurs="1"/>

You claimed it was valid, but I validated it myself and got the
following error message:

Severity        Description        Resource        In Folder
Location        Creation Time
2        src-resolve.4.2: Error resolving component 'C:ElementFromC'. It
was detected that 'C:ElementFromC' is in namespace
'http://www.testC.com', but components from this namespace are not
referenceable from schema document
'file:///D:/workspaces/James/Example/data/RLG/MISC/WSDL%202.0%20Problem%
20Examples/SchemaA.xsd'. If this is the incorrect namespace, perhaps the
prefix of 'C:ElementFromC' needs to be changed. If this is the correct
namespace, then an appropriate 'import' tag should be added to
'file:///D:/workspaces/James/Example/data/RLG/MISC/WSDL%202.0%20Problem%
20Examples/SchemaA.xsd'.        SchemaA.xsd
Example/data/RLG/MISC/WSDL 2.0 Problem Examples        line 18
July 20, 2005 12:23:32 AM

The error message says you need to import namespace C.

I am using the Xerces parser for validation (actually integrated in the
Eclipse Web Tools Platform which you can download from [1]. How are you
validating your schema?

[1] http://eclipse.org/webtools


Arthur Ryman,
Rational Desktop Tools Development

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
intranet: http://labweb.torolab.ibm.com/DRY6/


Arthur Ryman/Toronto/IBM
07/20/2005 12:00 AM To"RDBMS" <RDBMS@aol.com>, WSD WG
cc"Booth, David \(HP Software - Boston\)" <dbooth@hp.com>
SubjectRe: Whoops - Example is invalid  upate attachedLink






James,

I now undertand the confusion. In your example, you give an XML instance
document, ExampleSchemaHierarchy.xml, that contains elements declared in
the other schemas. In that case there is no need for an xs:import.

That is not what we are talking about in the WSDL 2.0 spec. There we are
taking about refering to element declarations via QNames.

When a WSDL document refers to an element declaration by QName, for
example to declare the messages in an operation, then it must have an
xs:import for the namespace of the element it is refering to. This is
just like in XSD when you build up a new element declaration from other
element declarations.

Arthur Ryman,
Rational Desktop Tools Development

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
intranet: http://labweb.torolab.ibm.com/DRY6/


"RDBMS" <RDBMS@aol.com>
07/19/2005 03:57 PM Please respond to
"RDBMS"

ToArthur Ryman/Toronto/IBM@IBMCA, "Booth, David \(HP Software -
Boston\)" <dbooth@hp.com>
cc
SubjectWhoops - Example is invalid  upate attached







Hi David, Arthur,

In my haste, I found that I had incorporated and invalid type
declaration.

In the attached, I've corrected it.

Thanks !
J. Bean
P.O. Box 30171
Phoenix, AZ  85046-0171

RDBMS@aol.com
XML-Guy@hotmail.com



Received on Wednesday, 20 July 2005 22:12:06 GMT

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