[ 
https://issues.apache.org/jira/browse/AXIS2-1809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496375
 ] 

Michael Krumpus commented on AXIS2-1809:
----------------------------------------

The solution to this is incorrect, and therefore code generation with XMLBeans 
is still broken in 1.1.1 and in 1.2. The patch supplied by Srinath was correct, 
but Amila changed it to use File.separator instead of "/".  This change was 
incorrect and code generation for schemas that include other schemas using 
relative paths including ".." does not work on Windows platforms.  This is 
because the File.separator on windows "\" cannot legally occur in the URI 
specified by an include statement's schemaLocation attribute.  The separator in 
URIs is "/" regardless of the platform.

References:
java.net.URI: http://java.sun.com/j2se/1.4.2/docs/api/java/net/URI.html
XML Schema specification for schemaLocation: 
http://www.w3.org/TR/xmlschema-1/#xsi.schemaLocation
Definition of schema type anyURI: 
http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#anyURI

Please change the two references to File.separator in 
org.apache.axis2.xmlbeans.CodeGenerationUtility back to "/".

Furthermore, even if "\" was a valid file separator it would be the wrong 
solution to have code generation work differently on different platforms.  That 
would mean that there would need to be a UNIX version of a system's schemas and 
a Windows version, and that the developer would have to use the version 
appropriate for the platform they were generating code on.  I am saying this 
from the perspective of a large enterprise that has literally thousands of 
schemas and hundreds of web services that share those schemas.  It's really 
important to have these tools work the same on different platforms for the same 
set of schemas.



> WSDL2Java tool fails to gather all the schemas if they are imported or 
> included using a path with '.' or '..'
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-1809
>                 URL: https://issues.apache.org/jira/browse/AXIS2-1809
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.1
>         Environment: Fedora core 3 with kernel version 2.6.12-1.1376_FC3smp
>            Reporter: Srinath
>         Assigned To: Davanum Srinivas
>         Attachments: axis2bug.zip, proposedFix.diff, xmlbeans.patch
>
>
> I was using the WSDL2Java tool to generate stubs for my WSDL.
> The wsdl imports schemas that in-turn include/import other schemas.
> These schemas specify the schemaLocation using a relative path.
> WSDL2Java fails to process these schemas. Code generation fails with error 
> messages saying "Element [EMAIL PROTECTED] does not exist", etc.
> Sometimes the error messages say "Duplicate global type:", etc.
> Looking into the org/apache/axis2/xmlbeans/CodeGenerationUtility.java, I can 
> see an issue with the way the systemId are being used to locate the schemas.
> If I import a schema with a relative path, for ex: 
> <import
>             namespace="http://www.abcdefghij.com/schemas/myschemas/";
>             schemaLocation="../schemas/myschema.xsd"/>
> The Axis2EntityResolver tries to find a schema whose sourceURI ends with the 
> systemId. This is incorrect since the sourceURI of a schema is always an 
> absolute path.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to