Hi,

I am using Axis 1.4, and I have a question regarding
WSDL2java and code generation.

I am trying to generate the code corresponding to a
union structure (see element named "type" in the
attached file ProbableCause.xsd).
I build the java code using the following command :
java -classpath $CLASSPATH
org.apache.axis.wsdl.WSDL2java --server-side -v
SpeedTest.wsdl

The generated code for ProbableCause_T.java seems ok. 
However, the generated code for
ProbableCause_TType.java seems bizarre to me.
Although the "type" consists of a union of possible
enumerations (ex "AIS"), the enumeration values are
not present in the generated java file, which makes me
think something's wrong there. 
Also, looking at the generated java code, it also
mentions that Simple Types must have a String
constructor, but this one hasn't any.
See the extract of the generated Java file (also
attached) :

public class ProbableCause_TType  implements
java.io.Serializable,
org.apache.axis.encoding.SimpleType {
    public ProbableCause_TType() {
    }

    // Simple Types must have a String constructor
    private java.lang.Object __equalsCalc = null;


Am I missing something here ?
I am not sure if the java file reflects accurately
what's in the xsd file, or not ...

Thanks,
John.


                
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com
<?xml version="1.0" encoding="UTF-8"?>
<!-- TMF854 Version 1.0 - Copyright TeleManagement Forum 2005, 2006 -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns="tmf854.v1" targetNamespace="tmf854.v1" attributeFormDefault="unqualified" elementFormDefault="qualified">
  <!-- ======= All includes  ======= -->
  <!-- <xsd:include schemaLocation="../common/Definitions.xsd"/> -->
  <!-- ============== All Global Type Declarations ========= --> 
  <xsd:complexType name="ProbableCause_T">
    <xsd:annotation>
      <xsd:documentation>
      The MTOSI alarm probable causes. For details refer to the supporting document: ProbableCauses.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:all>
      <xsd:element name="type">
        <xsd:annotation>
          <xsd:documentation>
          This is the probable cause specific value.
          </xsd:documentation>
        </xsd:annotation>
        <xsd:simpleType>
          <xsd:union>
            <xsd:simpleType>
              <xsd:annotation>
                <xsd:documentation>
                All the MTOSI extensions in a minor version.
                </xsd:documentation>
              </xsd:annotation>
              <xsd:restriction base="xsd:string">
                <xsd:pattern value="MINOR_([a-z]|[A-Z]|[0-9]|(_-))*"/>
              </xsd:restriction>
            </xsd:simpleType>
            <xsd:simpleType>
              <xsd:annotation>
                <xsd:documentation>
                All the MTOSI pre-defined probable causes.
                </xsd:documentation>
              </xsd:annotation>
              <xsd:restriction base="xsd:string">
                <xsd:enumeration value="UNIDENTIFIED"/>
                <xsd:enumeration value="AIS"/>
                <xsd:enumeration value="AMS"/>
                <xsd:enumeration value="ATPC_FAIL"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:union>
        </xsd:simpleType>
      </xsd:element>
    </xsd:all>
    <xsd:attribute name="overlap" type="xsd:string" use="optional"/>
    <xsd:attribute name="qualifier" type="xsd:string" use="optional"/>
  </xsd:complexType>
</xsd:schema>
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:SpeedTest" xmlns:apachesoap="http://xml.apache.org/xml-soap"; xmlns:impl="urn:SpeedTest" xmlns:intf="urn:SpeedTest"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:tmf854XSD="tmf854.v1">
<!--WSDL created by Apache Axis version: 1.2.1
Built on Jun 14, 2005 (09:15:57 EDT)-->

<wsdl:types>
<xsd:schema targetNamespace="tmf854.v1.ws">
  <xsd:import namespace="tmf854.v1" schemaLocation="ProbableCauses.xsd" /> 
</xsd:schema>
</wsdl:types>


   <wsdl:message name="getAlarmResponse">

      <wsdl:part name="getAlarmReturn" type="tmf854XSD:ProbableCause_T"/>

   </wsdl:message>

   <wsdl:message name="getAlarmRequest">

   </wsdl:message>

   <wsdl:portType name="SpeedTest">

      <wsdl:operation name="getAlarm">

         <wsdl:input message="impl:getAlarmRequest" name="getAlarmRequest"/>

         <wsdl:output message="impl:getAlarmResponse" name="getAlarmResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="SpeedTestSoapBinding" type="impl:SpeedTest">

      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="getAlarm">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getAlarmRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="urn:SpeedTest" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="getAlarmResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; namespace="urn:SpeedTest" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="SpeedTestService">

      <wsdl:port binding="impl:SpeedTestSoapBinding" name="SpeedTest">

         <wsdlsoap:address location="http://astevens-bsd53.uk.dev.micromuse.com:8180/axis/services/SpeedTest"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>
/**
 * ProbableCause_TType.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package v1.tmf854;

public class ProbableCause_TType  implements java.io.Serializable, 
org.apache.axis.encoding.SimpleType {
    public ProbableCause_TType() {
    }

    // Simple Types must have a String constructor
    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof ProbableCause_TType)) return false;
        ProbableCause_TType other = (ProbableCause_TType) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true;
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(ProbableCause_TType.class, 
true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("tmf854.v1", 
">ProbableCause_T>type"));
    }

    /**
     * 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);
    }

}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to