You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Susantha Kumara <su...@opensource.lk> on 2004/08/17 11:21:18 UTC

WSDL2Java does not recognize xml:lang ?

Hi All,
 
I ran the inquire_v2.wsdl and found that some attribute of following
complexType is not there in the corresponding generated Java class.
 
complexType in the wsdl,
 
      <xsd:complexType name="name">
            <xsd:simpleContent>
                  <xsd:extension base="string">
                        <xsd:attribute ref="xml:lang" use="optional"/>
                  </xsd:extension>
            </xsd:simpleContent>
      </xsd:complexType>
 
Generated Java class is attached.
 
It seems that the code generation has ignored 
 
<xsd:attribute ref="xml:lang" use="optional"/>
 
is this a bug ?.
 
while debugging the WSDL2Ws tool (we use Axis Java symbolTable etc) I
found that the types defined in xml namespace (xml:lang etc) are not
there in the symbolTable and hence no types are created. So simply this
attribute is ignored. How can I fix this problem ?.
 
Thanks,
 
Susantha Kumara
Virtusa (pvt) Ltd.
Office : +94112714385
Mobile : +94777420453
 

RE: WSDL2Java does not recognize xml:lang ?

Posted by Susantha Kumara <su...@opensource.lk>.
> -----Original Message-----
> From: Samisa Abeysinghe [mailto:samisa_abeysinghe@yahoo.com]
> Sent: Wednesday, August 18, 2004 1:15 PM
> To: Apache AXIS C Developers List
> Subject: Re: WSDL2Java does not recognize xml:lang ?
> 
> 
> --- Susantha Kumara <su...@opensource.lk> wrote:
> 
> > Hi All,
> >
> > I ran the inquire_v2.wsdl and found that some attribute of following
> > complexType is not there in the corresponding generated Java class.
> >
> > complexType in the wsdl,
> >
> >       <xsd:complexType name="name">
> >             <xsd:simpleContent>
> >                   <xsd:extension base="string">
> >                         <xsd:attribute ref="xml:lang"
use="optional"/>
> >                   </xsd:extension>
> >             </xsd:simpleContent>
> >       </xsd:complexType>
> >
> > Generated Java class is attached.
> >
> > It seems that the code generation has ignored
> >
> > <xsd:attribute ref="xml:lang" use="optional"/>
> >
> > is this a bug ?.
> 
> As I undestand this is not a bug. If the xml:lang referance refferes
to
> the type of language to be
> used, this attibute should be used to validate the 'vlaue' data
memeber of
> the generated class
> 'Name'.
> The generated java class has a data member named 'value' of type
String.
> However it has not made any porvisions to validate the content stored
> within 'value'. (may be it
> assumes language to be 'en')

I think there is something wrong with the java code generated with
WSDL2Java tool too. There should be an attribute in the name class for
"lang". The corresponding SOAP message should be like,

<name lang="en"> Some string in English</name>

> The problem with the class generated by WSDL2Ws tool is the 'value'
data
> member is missing.

Yes. Not only value but attribute too.

> 
> Samisa...
> 
> >
> > while debugging the WSDL2Ws tool (we use Axis Java symbolTable etc)
I
> > found that the types defined in xml namespace (xml:lang etc) are not
> > there in the symbolTable and hence no types are created. So simply
this
> > attribute is ignored. How can I fix this problem ?.
> >
> > Thanks,
> >
> > Susantha Kumara
> > Virtusa (pvt) Ltd.
> > Office : +94112714385
> > Mobile : +94777420453
> >
> > > /**
> >  * Name.java
> >  *
> >  * This file was auto-generated from WSDL
> >  * by the Apache Axis 1.2beta Mar 31, 2004 (12:47:03 EST) WSDL2Java
> emitter.
> >  */
> >
> > package api_v2.uddi_org;
> >
> > public class Name  implements java.io.Serializable,
> org.apache.axis.encoding.SimpleType {
> >     private java.lang.String value;
> >
> >     public Name() {
> >     }
> >
> >     // Simple Types must have a String constructor
> >     public Name(java.lang.String value) {
> >         this.value = value;
> >     }
> >     // Simple Types must have a toString for serializing the value
> >     public java.lang.String toString() {
> >         return value;
> >     }
> >
> >
> >     /**
> >      * Gets the value value for this Name.
> >      *
> >      * @return value
> >      */
> >     public java.lang.String getValue() {
> >         return value;
> >     }
> >
> >
> >     /**
> >      * Sets the value value for this Name.
> >      *
> >      * @param value
> >      */
> >     public void setValue(java.lang.String value) {
> >         this.value = value;
> >     }
> >
> >     private java.lang.Object __equalsCalc = null;
> >     public synchronized boolean equals(java.lang.Object obj) {
> >         if (!(obj instanceof Name)) return false;
> >         Name other = (Name) obj;
> >         if (obj == null) return false;
> >         if (this == obj) return true;
> >         if (__equalsCalc != null) {
> >             return (__equalsCalc == obj);
> >         }
> >         __equalsCalc = obj;
> >         boolean _equals;
> >         _equals = true &&
> >             ((this.value==null && other.getValue()==null) ||
> >              (this.value!=null &&
> >               this.value.equals(other.getValue())));
> >         __equalsCalc = null;
> >         return _equals;
> >     }
> >
> >     private boolean __hashCodeCalc = false;
> >     public synchronized int hashCode() {
> >         if (__hashCodeCalc) {
> >             return 0;
> >         }
> >         __hashCodeCalc = true;
> >         int _hashCode = 1;
> >         if (getValue() != null) {
> >             _hashCode += getValue().hashCode();
> >         }
> >         __hashCodeCalc = false;
> >         return _hashCode;
> >     }
> >
> >     // Type metadata
> >     private static org.apache.axis.description.TypeDesc typeDesc =
> >         new org.apache.axis.description.TypeDesc(Name.class, true);
> >
> >     static {
> >         typeDesc.setXmlType(new javax.xml.namespace.QName("urn:uddi-
> org:api_v2", "name"));
> >         org.apache.axis.description.ElementDesc elemField = new
> > org.apache.axis.description.ElementDesc();
> >         elemField.setFieldName("value");
> >         elemField.setXmlName(new javax.xml.namespace.QName("",
> "value"));
> >         elemField.setXmlType(new
> javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
> > "string"));
> >         typeDesc.addFieldDesc(elemField);
> >     }
> >
> >     /**
> >      * Return type metadata object
> >      */
> >     public static org.apache.axis.description.TypeDesc getTypeDesc()
{
> >         return typeDesc;
> >     }
> >
> >     /**
> >      * Get Custom Serializer
> >      */
> >     public static org.apache.axis.encoding.Serializer getSerializer(
> >            java.lang.String mechType,
> >            java.lang.Class _javaType,
> >            javax.xml.namespace.QName _xmlType) {
> >         return
> >           new  org.apache.axis.encoding.ser.SimpleSerializer(
> >             _javaType, _xmlType, typeDesc);
> >     }
> >
> >     /**
> >      * Get Custom Deserializer
> >      */
> >     public static org.apache.axis.encoding.Deserializer
getDeserializer(
> >            java.lang.String mechType,
> >            java.lang.Class _javaType,
> >            javax.xml.namespace.QName _xmlType) {
> >         return
> >           new  org.apache.axis.encoding.ser.SimpleDeserializer(
> >             _javaType, _xmlType, typeDesc);
> >     }
> >
> > }
> >
> 
> 
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> http://promotions.yahoo.com/new_mail


Re: WSDL2Java does not recognize xml:lang ?

Posted by Samisa Abeysinghe <sa...@yahoo.com>.
--- Susantha Kumara <su...@opensource.lk> wrote:

> Hi All,
>  
> I ran the inquire_v2.wsdl and found that some attribute of following
> complexType is not there in the corresponding generated Java class.
>  
> complexType in the wsdl,
>  
>       <xsd:complexType name="name">
>             <xsd:simpleContent>
>                   <xsd:extension base="string">
>                         <xsd:attribute ref="xml:lang" use="optional"/>
>                   </xsd:extension>
>             </xsd:simpleContent>
>       </xsd:complexType>
>  
> Generated Java class is attached.
>  
> It seems that the code generation has ignored 
>  
> <xsd:attribute ref="xml:lang" use="optional"/>
>  
> is this a bug ?.
 
As I undestand this is not a bug. If the xml:lang referance refferes to the type of language to be
used, this attibute should be used to validate the 'vlaue' data memeber of the generated class
'Name'. 
The generated java class has a data member named 'value' of type String.
However it has not made any porvisions to validate the content stored within 'value'. (may be it
assumes language to be 'en')
The problem with the class generated by WSDL2Ws tool is the 'value' data member is missing.

Samisa...

>  
> while debugging the WSDL2Ws tool (we use Axis Java symbolTable etc) I
> found that the types defined in xml namespace (xml:lang etc) are not
> there in the symbolTable and hence no types are created. So simply this
> attribute is ignored. How can I fix this problem ?.
>  
> Thanks,
>  
> Susantha Kumara
> Virtusa (pvt) Ltd.
> Office : +94112714385
> Mobile : +94777420453
>  
> > /**
>  * Name.java
>  *
>  * This file was auto-generated from WSDL
>  * by the Apache Axis 1.2beta Mar 31, 2004 (12:47:03 EST) WSDL2Java emitter.
>  */
> 
> package api_v2.uddi_org;
> 
> public class Name  implements java.io.Serializable, org.apache.axis.encoding.SimpleType {
>     private java.lang.String value;
> 
>     public Name() {
>     }
> 
>     // Simple Types must have a String constructor
>     public Name(java.lang.String value) {
>         this.value = value;
>     }
>     // Simple Types must have a toString for serializing the value
>     public java.lang.String toString() {
>         return value;
>     }
> 
> 
>     /**
>      * Gets the value value for this Name.
>      * 
>      * @return value
>      */
>     public java.lang.String getValue() {
>         return value;
>     }
> 
> 
>     /**
>      * Sets the value value for this Name.
>      * 
>      * @param value
>      */
>     public void setValue(java.lang.String value) {
>         this.value = value;
>     }
> 
>     private java.lang.Object __equalsCalc = null;
>     public synchronized boolean equals(java.lang.Object obj) {
>         if (!(obj instanceof Name)) return false;
>         Name other = (Name) obj;
>         if (obj == null) return false;
>         if (this == obj) return true;
>         if (__equalsCalc != null) {
>             return (__equalsCalc == obj);
>         }
>         __equalsCalc = obj;
>         boolean _equals;
>         _equals = true && 
>             ((this.value==null && other.getValue()==null) || 
>              (this.value!=null &&
>               this.value.equals(other.getValue())));
>         __equalsCalc = null;
>         return _equals;
>     }
> 
>     private boolean __hashCodeCalc = false;
>     public synchronized int hashCode() {
>         if (__hashCodeCalc) {
>             return 0;
>         }
>         __hashCodeCalc = true;
>         int _hashCode = 1;
>         if (getValue() != null) {
>             _hashCode += getValue().hashCode();
>         }
>         __hashCodeCalc = false;
>         return _hashCode;
>     }
> 
>     // Type metadata
>     private static org.apache.axis.description.TypeDesc typeDesc =
>         new org.apache.axis.description.TypeDesc(Name.class, true);
> 
>     static {
>         typeDesc.setXmlType(new javax.xml.namespace.QName("urn:uddi-org:api_v2", "name"));
>         org.apache.axis.description.ElementDesc elemField = new
> org.apache.axis.description.ElementDesc();
>         elemField.setFieldName("value");
>         elemField.setXmlName(new javax.xml.namespace.QName("", "value"));
>         elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema",
> "string"));
>         typeDesc.addFieldDesc(elemField);
>     }
> 
>     /**
>      * Return type metadata object
>      */
>     public static org.apache.axis.description.TypeDesc getTypeDesc() {
>         return typeDesc;
>     }
> 
>     /**
>      * Get Custom Serializer
>      */
>     public static org.apache.axis.encoding.Serializer getSerializer(
>            java.lang.String mechType, 
>            java.lang.Class _javaType,  
>            javax.xml.namespace.QName _xmlType) {
>         return 
>           new  org.apache.axis.encoding.ser.SimpleSerializer(
>             _javaType, _xmlType, typeDesc);
>     }
> 
>     /**
>      * Get Custom Deserializer
>      */
>     public static org.apache.axis.encoding.Deserializer getDeserializer(
>            java.lang.String mechType, 
>            java.lang.Class _javaType,  
>            javax.xml.namespace.QName _xmlType) {
>         return 
>           new  org.apache.axis.encoding.ser.SimpleDeserializer(
>             _javaType, _xmlType, typeDesc);
>     }
> 
> }
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail