SchemaBuilder handleSimpleType does not find default namespace which gives a NPE
--------------------------------------------------------------------------------

                 Key: WSCOMMONS-87
                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-87
             Project: WS-Commons
          Issue Type: Bug
          Components: XmlSchema
         Environment: WinXP home, jdk 1.5.0_06,
also reported as xfire-617
            Reporter: Marc Gagnon


This issue was reported on axis2's user list and later in xfire as issue 
xfire-617.

I've been able to reproduce the issue in XmlSchema independently of xfire (see 
attached files).

To reproduce, get XmlSchema (I used 1.0.3, same behavior as 1.0.1) and unzip 
IncludeTest.java in the tests directory, unzip the xsd files in test-resources 
and run the unit tests.

One test case is ok: the one which defines a default namespace in the included 
file.
The other test case fails because there is no default namespace defined, just 
like in OTA_SimpleTypes.xsd

Sample xsd from the attachement:

<schema targetNamespace="http://soapinterop.org/xsd";
xmlns="http://www.w3.org/2001/XMLSchema";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsd1="http://soapinterop.org/xsd";
xmlns:xsd2="http://soapinterop.org/xsd2";
elementFormDefault="qualified">
<include schemaLocation="includeAux.xsd"/>
</schema>
includeAux=
<schema 
xmlns="http://www.w3.org/2001/XMLSchema";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:xsd1="http://soapinterop.org/xsd2";
elementFormDefault="qualified">
<xs:simpleType name="PaymentCardCodeType">
<xs:union>
<xs:simpleType>
<xs:restriction base="UpperCaseAlphaLength1to2"/>
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:simpleType name="UpperCaseAlphaLength1to2">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]{1,2}"/>
</xs:restriction>
</xs:simpleType>
</schema>

This example is ok, remove line <<xmlns="http://www.w3.org/2001/XMLSchema";>> in 
the file above and it will fail. It seems to me that this declaration should be 
considered implicit and this should be handled in ShemaBuilder.handleSimpleType



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to