You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Arnoud de Bruijn <ad...@gmail.com> on 2009/01/13 11:11:56 UTC

[Axis2] wsdl2java code won't compile

Hi everyone,

Hopefully I've found the correct place for my comments, if not, please be so
kind as to redirect me to the correct place.

While processing a wsdl-file wsdl2java generates code that won't compile,
because of non-existing
org.apache.axis2.databinding.utils.ConverterUtil.convertTo-calls. After
doing some digging I came up with the following.

1) The wsdl-file imports two xsd-schema's: schemaX and schemaY
2) schemaX imports schemaY
3) elementX from schemaX references elementY1 from schemaY
4) elementY1 references elementY2 from schemaY
5) elementX, elementY1 and elementY2 all have anonymous types
6) Removing the import schemaY from the wsdl-file generates correct code
7) Eliminating the reference from elementY1 to elementY2 generates correct
code
8) The order of schema processing by org.apache.axis2.schema.SchemaCompiler
is: schemaY, schemaX

It turns out that while processing the reference, the call to
getParentSchema (SchemaCompiler.java:2137) returns the unprocessed import
schemaY from schemaX, causing it to register the mapping (line 2147) with a
null-value for the schemaTypName (the anon-type from the import has not been
processed). This, in turn, causes the the 'ours'-attribute at
JavaBeanWriter.java:887 to no be set and thus generating the incorrect code.

To solve this, I've changed getParentSchema@SchemaCompiler.java:2630 to
first check to see if the element can be found in a schema that has either
been processed or is available. If neither, it then checks the imports.

Any ideas/suggestions/comments/better solutions?

Cheers,
Arnoud


-- 
View this message in context: http://www.nabble.com/-Axis2--wsdl2java-code-won%27t-compile-tp21432597p21432597.html
Sent from the Axis - User mailing list archive at Nabble.com.