You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by John Kaputin <KA...@uk.ibm.com> on 2006/01/17 16:22:51 UTC

XmlSchemaSimpleType bug?

I have encountered an error with XmlSchema which I can look into next week,
unless anyone else has a solution sooner.

I was using Woden with the W3C WSDL 2.0 test case:
http://dev.w3.org/cvsweb/~checkout~/2002/ws/desc/test-suite/documents/good/CreditCardFaults-1G/use-credit-card-faults.wsdl

When Woden uses XmlSchema to parse an xs:import, an
IllegalArgumentException is thrown by the QName ctor invoked by
XmlSchemaType.getQName because the localPart argument on the ctor is null.

The relevent schema fragment from credit-card-faults.xsd is:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://finance.example.com/CreditCardFaults/xsd"
      xmlns:tns="http://finance.example.com/CreditCardFaults/xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
              http://www.w3.org/2001/XMLSchema.xsd">

      <element name="CreditCardNumber" type="string"></element>

      <element name="CreditCardType">
            <simpleType>
                  <restriction base="string">
                        <enumeration value="AMEX" />
                        <enumeration value="MASTERCARD" />
                        <enumeration value="VISA" />
                  </restriction>
            </simpleType>
      </element>
            .....

The "CreditCardType" element contains a simpleType definition, which
correctly has no name. The XmlSchemaSimpleType object has a 'name' field
with a null value in this case. It attempts to create a QName for the type
def, passing the name value as the localpart argument on the QName ctor.
Because the name is null in this case, it results in an
IllegalArgumentException.

regards,
John Kaputin