axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Werner Dittmann (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2-3577) WSDL2java generates wrong code and wsdl in resource directory
Date Thu, 06 Mar 2008 20:20:58 GMT
WSDL2java generates wrong code and wsdl in resource directory
-------------------------------------------------------------

                 Key: AXIS2-3577
                 URL: https://issues.apache.org/jira/browse/AXIS2-3577
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: wsdl
    Affects Versions: 1.3
         Environment: Linux, Windows, JDK 1.6, Axis2 1.3 binary download
            Reporter: Werner Dittmann
             Fix For: 1.3


Using complex types (see below) with restrictions and enumerations or minInclusive/maxInclusive
causes WSDL2java to generate wrong code and to produce a wrong WSDL in the resource directors.


I used the following wsdl2java command:
wsdl2java.sh -wv 2.0 -ss -u -p caservice -uri ca-interface.wsdl

The problem also occurs if I use WSDL 1.1 . The generated code shows  that every other enumeration
is missing. The same is true for the minInclusive / maxInclusive restriction type.

Here a code snippet of the complex types I use:

...
      <simpleType name="keyType" >
        <restriction base="string">
          <enumeration value="primary" />
          <enumeration vaule="secondary" />
          <enumeration value="third" />
        </restriction>
      </simpleType>

      <element name="key" type="tns:keyType" />

      <simpleType name="modeType" >
        <restriction base="long">
          <minInclusive value="0" />
          <maxInclusive vaule="1" />
        </restriction>
      </simpleType>

      <element name="mode" type="tns:modeType" />
...

WSDL2java generates to following code for KeyType(snippet):
...
public class KeyType implements org.apache.axis2.databinding.ADBBean {
    public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://tst.org/types",
            "keyType", "ns1");
    private static java.util.HashMap _table_ = new java.util.HashMap();
    public static final java.lang.String _value1 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
            "primary");
    public static final java.lang.String _value2 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
            "");
    public static final java.lang.String _value3 = org.apache.axis2.databinding.utils.ConverterUtil.convertToString(
            "third");
    public static final KeyType value1 = new KeyType(_value1, true);
    public static final KeyType value2 = new KeyType(_value2, true);
    public static final KeyType value3 = new KeyType(_value3, true);

    /**
     * field for KeyType
     */
    protected java.lang.String localKeyType;

    // Constructor
    protected KeyType(java.lang.String value, boolean isRegisterValue) {
        localKeyType = value;

        if (isRegisterValue) {
            _table_.put(localKeyType, this);
        }
    }
 ...

Also the class has a protected constructor only, no unprotected default constructor.

The code snippet for the ModeType (minIclusive/maxInclusive problem):
...
     */
    public void setModeType(long param) {
        if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "") <= 0) {
            this.localModeType = param;
        } else {
            throw new java.lang.RuntimeException();
        }

        if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "0") >= 0)
{
            this.localModeType = param;
        } else {
            throw new java.lang.RuntimeException();
        }
    }
....
As you can see the second value (maxInclusive) is missing, it's just an empty string.

When I use -wv 2.0 wsdl2java create the follwoing wsdl in the resource directory (snippet)
...
<xs:simpleType name="keyType">
<xs:restriction base="string">
<xs:enumeration value="primary" />
<xs:enumeration value="" />
<xs:enumeration value="third" />
</xs:restriction>
</xs:simpleType>
<xs:element name="key" type="types:keyType" />
<xs:simpleType name="modeType">
<xs:restriction base="long">
<xs:minInclusive value="0" />
<xs:maxInclusive value="" />
</xs:restriction>
</xs:simpleType>
...

Same as for Java code - the second (or every other) value is missing.

Any Ideas?

Best regards,
Werner


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message