[ 
https://issues.apache.org/jira/browse/AXIS2-5169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shameera Rathnayaka updated AXIS2-5169:
---------------------------------------

    Attachment: test.wsdl


you can find sample wsdl to reproduce this error 
                
> WSDL2Java tool fail when wsdl has a ref element has an anonymous complextype 
> -----------------------------------------------------------------------------
>
>                 Key: AXIS2-5169
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5169
>             Project: Axis2
>          Issue Type: Improvement
>          Components: adb, codegen, Tools
>    Affects Versions: 1.7.0
>            Reporter: Shameera Rathnayaka
>            Assignee: Shameera Rathnayaka
>         Attachments: test.wsdl
>
>
> If i run wsdl2java with a wsdl which has a ref element with an anonymous 
> complextype then it gives following error
> Exception in thread "main" 
> org.apache.axis2.wsdl.codegen.CodeGenerationException: 
> java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
>       at 
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:293)
>       at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:44)
> This is because, following code segment in SchemaCompiler class add null 
> value as the javaClassName when ref element has an anonymous complextype
>                 if (xmlSchemaType != null) {
>                     if 
> (!this.processedElementRefMap.containsKey(referencedElement.getQName())) {
>                         // we know this is a named complex type
>                         processSchema(referencedElement, xmlSchemaType, 
> newResolvedSchema, false);
>                         // if this is an anonomous complex type we have to 
> set this
>                         
> this.processedElementRefMap.put(referencedElement.getQName(),
>                                 this.processedTypemap.get(schemaTypeName));
>                     }
>                     String javaClassName = 
> this.processedTypemap.get(referencedElement.getSchemaTypeName());
>                     
> referencedElement.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY,
>                             javaClassName);
>                     
> xsElt.addMetaInfo(SchemaConstants.SchemaCompilerInfoHolder.CLASSNAME_KEY,
>                             javaClassName);
>                 } else {
>                     throw new SchemaCompilationException(" Can not find the 
> schema type with name " + schemaTypeName);
>                 }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org
For additional commands, e-mail: java-dev-h...@axis.apache.org

Reply via email to