Hello!

Sorry for the long message but I thought that I needed
to explain my problem in detail :)

My problem is that I have a couple of  SimpleTypes
defined in a WSDL document as the one defined below
and the classes generated for the simple types becomes
“empty”.  I.e. there is no private variable holding
the value. It just a class with the methods for equals
and hashcode defined and implementing the interfaces
java.io.Serializable,
org.apache.axis.encoding.SimpleType.

<xsd:simpleType name="MessageType">
   <xsd:restriction>
      <xsd:simpleType>
         <xsd:restriction base="xsd:string">
            <xsd:whiteSpace value="preserve"/>
         </xsd:restriction>
      </xsd:simpleType>
      <xsd:enumeration value="Activation"/>
      <xsd:enumeration value="Modification"/>
      <xsd:enumeration value="Cancellation"/>
   </xsd:restriction>
</xsd:simpleType>

I have tried to genereate classes using glue from
webmethods and then it works as expected and they do
create simple types with getter and setter methods as
expected.

So to get it to work with simple types I need to
either change the WSDL file or to add code as in the
end to get it to work. 

If I change the WSDL as then it works and no empty
simple type classes are generated instead I can just
set the value directly in the class for the complex
type.
From: <xsd:element name="Request_Type"
type="tns:MessageType"/>
TO: <xsd:element name="Request_Type"
type="xsd:string"/>


Is there some kind of flag that I have forgotten to
set since I don’t manully want to go in and change
code generated, and I would rather not have to change
the WSDL file.

Cheers,
paul

<CODE I need to add to get it to work>

    //No value present need to add it
    private java.lang.String value;

    // Simple Types must have a String constructor
    public
CompanionProductMessageType(java.lang.String value) {
        this.value = new java.lang.String(value);
    }

    // Simple Types must have a toString for
serializing the value
    public java.lang.String toString() {
        return value == null ? null :
value.toString();
    }

    public java.lang.String getValue() {
        return value;
    }

    public void setValue(java.lang.String value) {
        this.value = value;
    }

</CODE I need to add to get it to work>


Reply via email to