Axis2 1.4 Codegen bug: impossible filename for written schemas
--------------------------------------------------------------
Key: AXIS2-3810
URL: https://issues.apache.org/jira/browse/AXIS2-3810
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Components: codegen
Affects Versions: 1.4
Environment: Windows XP
Reporter: Michael Pollmeier
Attachments: META-INF.zip
Hey Axis team!
Seems like I discovered an Axis2 1.4 Codegen bug, please have a look:
I created some services with similar wsdls and the same schemas, all
wsdl/xsd/services.xml files are in attached META-INF.zip.
Now I want to create a client stub for that, using the following command:
call "%AXIS2_HOME%\bin\wsdl2java" -uri %WSDL_URI% -ss -sd -d adb -o out
If AXIS2_HOME is Axis2 1.3 and WSDL_URI is the normal http uri
(http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?wsdl), it
works.
If AXIS2_HOME is Axis2 1.4 and WSDL_URI is a file based uri
(D:\proj\BiPRO\sundn_implementierungen\STS\workspace\STS\resources\SecurityTokenServiceUsernamePW.wsdl),
it works.
But if I use Axis2 1.4 and the http uri, it does not work, and that seems to be
only on windows systems, as it's a problem with the file names of the stored
xsds: Axis2 Codegen want's to save a file with "special-characters" (?, =), and
windows cannot deal with that...
But I cannot change the wsdl, so that's not an option for me.
See console output:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
D:\proj\BiPRO\sundn_implementierungen\STS\workspace\wsdl\test>call
"C:\develop\axis2-1.4\bin\wsdl2java" -uri
http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?wsdl -ss
-sd -d adb -o out
Using AXIS2_HOME: C:\develop\axis2-1.4
Using JAVA_HOME: C:\develop\Java\jdk1.5.0_10
Retrieving document at
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?wsdl'.
Retrieving schema at 'SecurityTokenServiceUsernamePW?xsd=ws-policy.xsd',
relative to
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?wsdl'.
Retrieving schema at 'oasis-200401-wss-wssecurity-utility-1.0.xsd', relative to
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?xsd=ws-policy.xsd'.
Retrieving schema at 'oasis-200401-wss-wssecurity-secext-1.0.xsd', relative to
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?xsd=ws-policy.xsd'.
Retrieving schema at 'xml.xsd', relative to
'http://localhost:8180/bipro/services/oasis-200401-wss-wssecurity-secext-1.0.xsd'.
Retrieving schema at 'xmldsig-core-schema.xsd', relative to
'http://localhost:8180/bipro/services/oasis-200401-wss-wssecurity-secext-1.0.xsd'.
Retrieving schema at 'oasis-200401-wss-wssecurity-utility-1.0.xsd', relative to
'http://localhost:8180/bipro/services/oasis-200401-wss-wssecurity-secext-1.0.xsd'.
Retrieving schema at 'SecurityTokenServiceUsernamePW?xsd=WS-Trust.xsd',
relative to
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?wsdl'.
Retrieving schema at 'addressing.xsd', relative to
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?xsd=WS-Trust.xsd'.
Retrieving schema at 'oasis-200401-wss-wssecurity-utility-1.0.xsd', relative to
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?xsd=WS-Trust.xsd'.
Retrieving schema at 'ws-policy.xsd', relative to
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?xsd=WS-Trust.xsd'.
Retrieving schema at 'oasis-200401-wss-wssecurity-utility-1.0.xsd', relative to
'http://localhost:8180/bipro/services/ws-policy.xsd'.
Retrieving schema at 'oasis-200401-wss-wssecurity-secext-1.0.xsd', relative to
'http://localhost:8180/bipro/services/ws-policy.xsd'.
Retrieving schema at 'oasis-200401-wss-wssecurity-secext-1.0.xsd', relative to
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?xsd=WS-Trust.xsd'.
Retrieving schema at
'SecurityTokenServiceUsernamePW?xsd=ws-secureconversation.xsd', relative to
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?wsdl'.
Retrieving schema at 'oasis-200401-wss-wssecurity-utility-1.0.xsd', relative to
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?xsd=ws-secureconversation.xsd'.
Retrieving schema at 'oasis-200401-wss-wssecurity-secext-1.0.xsd', relative to
'http://localhost:8180/bipro/services/SecurityTokenServiceUsernamePW?xsd=ws-secureconversation.xsd'.
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException:
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: Schema writing failed!
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: Schema writing failed!
at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitSkeleton(AxisServiceBasedMultiLanguageEmitter.java:1370)
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:253)
... 2 more
Caused by: java.lang.RuntimeException: Schema writing failed!
at
org.apache.axis2.wsdl.codegen.writer.SchemaWriter.writeSchema(SchemaWriter.java:60)
at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.writeWSDLFiles(AxisServiceBasedMultiLanguageEmitter.java:1412)
at
org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.emitSkeleton(AxisServiceBasedMultiLanguageEmitter.java:1341)
... 3 more
Caused by: java.io.FileNotFoundException:
out\resources\SecurityTokenServiceUsernamePW?xsd=ws-secureconversation.xsd (Die
Syntax f³r den Dateinamen, Verzeichnisnamen oder die Datentrõgerbezeichnung ist
falsch)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at
org.apache.axis2.wsdl.codegen.writer.SchemaWriter.writeSchema(SchemaWriter.java:51)
... 5 more
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
This problem only affects those XSDs that are directly referenced in the wsdl.
All others work.
I already debugged the Codegen and saw that the SchemaWriter gets the '?' in
the schemaFileName, which originally comes from the AxisService's schemaMap:
[EMAIL PROTECTED]://schemas.xmlsoap.org/ws/2004/08/addressing], [EMAIL
PROTECTED]://schemas.xmlsoap.org/ws/2005/02/sc], [EMAIL
PROTECTED]://schemas.xmlsoap.org/ws/2004/09/policy], [EMAIL
PROTECTED]://www.w3.org/2000/09/xmldsig#], [EMAIL
PROTECTED]://www.w3.org/XML/1998/namespace]]
Any ideas?
Thanks in advance and greetings from Germany
Michael
--
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]