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 Andy Dolbey <an...@gmail.com> on 2005/09/07 08:45:54 UTC

WSDL2Java and complexType problem

Hi,

We are using in my lab a WSDL that contains complexType definitions
which are pretty much just some string arrays (attached with this
message).  The WSDL was autogenerated with a CommonLisp SOAP API. 
When I first ran WSDL2Java on it, I was using axis-1_1RC2, and it
seemed to handle the WSDL with no problems.  One of the source files
that it generated was a class for the complexType definition.  All the
java that was generated was able to compile, and enabled us to connect
with the service without any problems.  However, I have now tried
using WSDL2Java with 3 newer Axis versions:  axis-1_2RC1, axis-1_2RC2,
and axis-1_2_1.  These all generate java that compiles, but with each
of them, I now get a SAX error at run time.  We looked through the
generated code to see if we could find differences that could explain
this.  Sure enough, we found a set of differences in the source for
the WSDL's complexType cases.  Here's an example of what the
differences looks like:

- axis-1_1RC2

       org.apache.axis.description.ElementDesc elemField = new
org.apache.axis.description.ElementDesc();
       elemField.setFieldName("idvalues");
       elemField.setXmlName(new javax.xml.namespace.QName("", "idvalues"));
       elemField.setXmlType(new
javax.xml.namespace.QName("http://compbio.uchsc.edu/Hunter_lab/McGoldrick/DtronRPC20050307-iniasrv.wsdl",
"DtronRPCServiceType004"));
       elemField.setMinOccurs(0);
       typeDesc.addFieldDesc(elemField);


- axis-1_2RC2

       org.apache.axis.description.ElementDesc elemField = new
org.apache.axis.description.ElementDesc();
       elemField.setFieldName("idvalues");
       elemField.setXmlName(new javax.xml.namespace.QName("", "idvalues"));
       elemField.setXmlType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
"string"));
       elemField.setMinOccurs(0);
       typeDesc.addFieldDesc(elemField);


Somehow WSDL2Java switched out the location of the XmlType definition
from the WSDL to a w3.org 2001 XMLSchema spec, and more importantly,
changed what should've been a complexType specification to just a
simple "string".  This is the source of the runtime SAX errors.

Does anybody have any idea why all of the axis-1_2 versions do this,
especially given that axis-1_1 did not?  The source that the axis-1_2
versions generate for the complexType elements is otherwise nearly
identical to axis-1_1's version, making this extra weird and
frustrating.

Thanks for whatever help and/or info anyone can provide!

Andy