Hi all,

having had an ingenious idea, I guess I found the bug in "WSDL2Java.sh".

The functional difference between the Windows and Unix version of this script is in how to invoke Java. While the Windows version uses a special variable "%*" to pass all command line arguments from the script to java:

%_RUNJAVA% %JAVA_OPTS% -cp "%AXIS2_CLASS_PATH%" org.apache.axis2.wsdl.WSDL2Java %*

the Unix version simply uses the first nine positional parameters:

java -classpath $AXIS2_CLASSPATH org.apache.axis2.wsdl.WSDL2Java $1 $2 $3 $4 $5 $6 $7 $8 $9

I guess that the Linux shells transparently pack all remaining arguments into $9 when there are more than 9 command line arguments to the shell script. Well, Mac OS X's bash obviously doesn't.

The simple yet effective fix is to use "$*" in WSDL2Java.sh as well.

The fixed shell script is attached.

Cheers,
Michel

Attachment: WSDL2Java.sh
Description: Binary data


On 26 Apr 2006, at 20:09, Michel.Drescher (JIRA) wrote:

     [ http://issues.apache.org/jira/browse/AXIS2-624?page=all ]

Michel.Drescher updated AXIS2-624:
----------------------------------

    Attachment: rbyteio-complete.wsdl

This is the WSDL file used as per my last comment.

CLONE -WSDL2Java: Buggy command line parsing
--------------------------------------------

         Key: AXIS2-624
         URL: http://issues.apache.org/jira/browse/AXIS2-624
     Project: Apache Axis 2.0 (Axis2)
        Type: Bug

  Components: Tools
    Versions: 0.95
 Environment: Axis2 0.95 standard binary release
    Reporter: Michel.Drescher
    Assignee: Ajith Harshana Ranabahu
    Priority: Minor
 Attachments: rbyteio-complete.wsdl

The way WSDL2Java parses the command line parameters is buggy:
"sh WSDL2Java.sh -uri ./example.wsdl -s -ss -sd -p com.example.impl -d xmlbeans -g -o ./" works fine (no exceptions thrown - didn't check the generated code yet) while "sh WSDL2Java.sh -uri ./example.wsdl -o ./ -s -ss -sd -p com.example.impl -d xmlbeans -g"
throws the following exception:
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: Unsupported content Simple Content Extension ! at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate (CodeGenerationEngine.java:146)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
        at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
Caused by: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: Unsupported content Simple Content Extension ! at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage (SimpleDBExtension.java:162) at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate (CodeGenerationEngine.java:101)
        ... 2 more
Caused by: org.apache.axis2.schema.SchemaCompilationException: Unsupported content Simple Content Extension ! at org.apache.axis2.schema.SchemaCompiler.processSimpleContent (SchemaCompiler.java:803) at org.apache.axis2.schema.SchemaCompiler.processContentModel (SchemaCompiler.java:672) at org.apache.axis2.schema.SchemaCompiler.processComplexType (SchemaCompiler.java:654) at org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType( SchemaCompiler.java:604) at org.apache.axis2.schema.SchemaCompiler.processSchema (SchemaCompiler.java:569) at org.apache.axis2.schema.SchemaCompiler.processElement (SchemaCompiler.java:360) at org.apache.axis2.schema.SchemaCompiler.processElement (SchemaCompiler.java:328) at org.apache.axis2.schema.SchemaCompiler.process (SchemaCompiler.java:899) at org.apache.axis2.schema.SchemaCompiler.processParticle (SchemaCompiler.java:862) at org.apache.axis2.schema.SchemaCompiler.processComplexType (SchemaCompiler.java:631) at org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType( SchemaCompiler.java:604) at org.apache.axis2.schema.SchemaCompiler.processSchema (SchemaCompiler.java:569) at org.apache.axis2.schema.SchemaCompiler.processElement (SchemaCompiler.java:360) at org.apache.axis2.schema.SchemaCompiler.processElement (SchemaCompiler.java:338) at org.apache.axis2.schema.SchemaCompiler.compile (SchemaCompiler.java:220) at org.apache.axis2.schema.SchemaCompiler.compile (SchemaCompiler.java:179) at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage (SimpleDBExtension.java:115)
        ... 3 more
Note that in both commands only the -o parameter changed position.
This works with any WSDL file that uses Simple Content Extension.

--
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


Reply via email to