DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14510>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14510 Bug in <element ref="...">. [EMAIL PROTECTED] changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | ------- Additional Comments From [EMAIL PROTECTED] 2002-12-01 22:04 ------- Got this by email from [EMAIL PROTECTED] ================================================================================ Hi! Unfortunately I have found that we cannot change method public TypeEntry getTypeEntry(QName qname, boolean wantElementType). It deeply depends on other logic (array of ref type are not generated correctely). Instead of this I have proposed more local fix that is in process of java file generation. I have sent it in "Invalid metadata when schema contains <element ref="..."/> construction." to [EMAIL PROTECTED] <[EMAIL PROTECTED]> at Thursday, 14 November, 2002 12:46. this is excerption of it: I am trying to use Axis 1.0 for creating uddi client web service. But I have found that Axis cannot handle uddi's wsdl file (version 2.0). I have discovered that Axis generates not correct metadata in some cases . This leads to incorrect behaviour at runtime. In particular I have found that such construction: ... <xsd:element name="authInfo" type="string"/> ... <xsd:element name="authToken" type="uddi:authToken"/> <xsd:complexType name="authToken"> <xsd:sequence> <xsd:element ref="uddi:authInfo"/> <!-- this construction is not handled by Axis --> </xsd:sequence> <xsd:attribute name="generic" type="string" use="required"/> <xsd:attribute name="operator" type="string" use="required"/> </xsd:complexType> ... is mapped to metadata in the following way public class AuthToken implements java.io.Serializable { ... static { org.apache.axis.description.FieldDesc field = new org.apache.axis.description.AttributeDesc(); field.setFieldName("generic"); field.setXmlName(new javax.xml.namespace.QName("", "generic")); field.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); typeDesc.addFieldDesc(field); field = new org.apache.axis.description.AttributeDesc(); field.setFieldName("operator"); field.setXmlName(new javax.xml.namespace.QName("", "operator")); field.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); typeDesc.addFieldDesc(field); field = new org.apache.axis.description.ElementDesc(); field.setFieldName("authInfo"); field.setXmlName(new javax.xml.namespace.QName("urn:uddi-org:api_v2", "authInfo")); field.setXmlType(new javax.xml.namespace.QName("urn:uddi-org:api_v2", "authInfo")); // <-- (1) look at this typeDesc.addFieldDesc(field); }; ... } As we see at line (1) authInfo is mapped to some xml type QName("urn:uddi-org:api_v2", "authInfo"). But there is no such a type at all. In fact this leads to that the authInfo field remains empty (null) at runtime when object of type AuthToken is deserialized. I suppose more correct code would be: ... field = new org.apache.axis.description.ElementDesc(); field.setFieldName("authInfo"); field.setXmlName(new javax.xml.namespace.QName("urn:uddi-org:api_v2", "authInfo")); field.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); ... In order to chage generation I have changed a little JavaBeanHelperWriter.writeMetaData: protected void writeMetaData(PrintWriter pw) throws IOException { ... // old code block: /* QName xmlType = elem.getType().getQName(); if (xmlType != null && xmlType.getLocalPart().indexOf("[") > 0) { // Skip array types, because they are special xmlType = null; } */ // I have changed by TypeEntry typeEntry=elem.getType(); QName xmlType = typeEntry.getQName(); if (xmlType != null && xmlType.getLocalPart().indexOf("[") > 0) { // Skip array types, because they are special xmlType = null; } else { TypeEntry refType=typeEntry.getRefType(); if (refType!=null) xmlType=refType.getQName(); } ... } These changes bring correct output. -------------------------------- Nesterovsky Vladimir e-mail: [EMAIL PROTECTED] ================================================================================