Issue Details (XML | Word | Printable)

Key: WSCOMMONS-87
Type: Bug Bug
Status: Resolved Resolved
Resolution: Duplicate
Priority: Major Major
Assignee: Unassigned
Reporter: Marc Gagnon
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
WS-Commons

SchemaBuilder handleSimpleType does not find default namespace which gives a NPE

Created: 08/Sep/06 01:34 PM   Updated: 08/Sep/06 07:59 PM
Return to search
Component/s: XmlSchema
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Zip Archive Licensed for inclusion in ASF works XmlSchemaTestInclude.zip 2006-09-08 01:39 PM Marc Gagnon 2 kB
Environment:
WinXP home, jdk 1.5.0_06,
also reported as xfire-617
Issue Links:
Duplicate
 

Resolution Date: 08/Sep/06 07:59 PM


 Description  « Hide
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



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Marc Gagnon made changes - 08/Sep/06 01:39 PM
Field Original Value New Value
Attachment XmlSchemaTestInclude.zip [ 12340458 ]
Jochen Wiedmann made changes - 08/Sep/06 07:59 PM
Link This issue duplicates WSCOMMONS-78 [ WSCOMMONS-78 ]
Jochen Wiedmann made changes - 08/Sep/06 07:59 PM
Resolution Duplicate [ 3 ]
Status Open [ 1 ] Resolved [ 5 ]