You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Colin Anderson (JIRA)" <ji...@apache.org> on 2008/12/29 14:44:44 UTC

[jira] Created: (AXIS2-4190) WSDL2JAVA Not generating code for when databinding is ADB.

WSDL2JAVA Not generating code for <xsd:totalDigits> when databinding is ADB.
----------------------------------------------------------------------------

                 Key: AXIS2-4190
                 URL: https://issues.apache.org/jira/browse/AXIS2-4190
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb, codegen
    Affects Versions: 1.3, 1.4, 1.4.1
         Environment: Any
            Reporter: Colin Anderson


I have the following definition in an XSD:

<xsd:simpleType name="tariffID">
    <xsd:annotation>
        <xsd:documentation>Standard tariff ID</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:decimal">
        <xsd:totalDigits value="7"/>
    </xsd:restriction>
 </xsd:simpleType>

When I generate the Java code I get the TariffID type as expected, but in the generated setTariffID(int) method, there is no code generated that captures the <xsd:totalDigits> restriction:

/**
 * Auto generated setter method
 * @param param TariffID
 */
  public void setTariffID(int param){
    this.localTariffID=param;
  }

If I then add either <xsd:pattern> or <xsd:minInclusive> and <xsd:maxInclusive> to the XSD then these restrictions are captured in the generated code.  For example, this:

<xsd:simpleType name="tariffID">
    <xsd:annotation>
        <xsd:documentation>Standard tariff ID</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:int">
        <xsd:totalDigits value="7"/>
        <xsd:minInclusive value="0"/>
        <xsd:maxInclusive value="9999999"/>
    </xsd:restriction>
</xsd:simpleType>

results in the following Java code being generated:

/**
 * Auto generated setter method
 * @param param TariffID
 */
public void setTariffID(int param){
  if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "9999999") <= 0){

    this.localTariffID=param;
  }
  else {
    throw new java.lang.RuntimeException();
  }                                       
  if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "0") >= 0){
    this.localTariffID=param;
  }
  else {
    throw new java.lang.RuntimeException();
  }
}

I and others on the user mailing list believe this is a bug in the ADB databinding code generation. 

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


[jira] Assigned: (AXIS2-4190) WSDL2JAVA Not generating code for when databinding is ADB.

Posted by "Deepal Jayasinghe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Deepal Jayasinghe reassigned AXIS2-4190:
----------------------------------------

    Assignee: Amila Chinthaka Suriarachchi

> WSDL2JAVA Not generating code for <xsd:totalDigits> when databinding is ADB.
> ----------------------------------------------------------------------------
>
>                 Key: AXIS2-4190
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4190
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb, codegen
>    Affects Versions: 1.4.1, 1.4, 1.3
>         Environment: Any
>            Reporter: Colin Anderson
>            Assignee: Amila Chinthaka Suriarachchi
>
> I have the following definition in an XSD:
> <xsd:simpleType name="tariffID">
>     <xsd:annotation>
>         <xsd:documentation>Standard tariff ID</xsd:documentation>
>     </xsd:annotation>
>     <xsd:restriction base="xsd:int">
>         <xsd:totalDigits value="7"/>
>     </xsd:restriction>
>  </xsd:simpleType>
> When I generate the Java code I get the TariffID type as expected, but in the generated setTariffID(int) method, there is no code generated that captures the <xsd:totalDigits> restriction:
> /**
>  * Auto generated setter method
>  * @param param TariffID
>  */
>   public void setTariffID(int param){
>     this.localTariffID=param;
>   }
> If I then add either <xsd:pattern> or <xsd:minInclusive> and <xsd:maxInclusive> to the XSD then these restrictions are captured in the generated code.  For example, this:
> <xsd:simpleType name="tariffID">
>     <xsd:annotation>
>         <xsd:documentation>Standard tariff ID</xsd:documentation>
>     </xsd:annotation>
>     <xsd:restriction base="xsd:int">
>         <xsd:totalDigits value="7"/>
>         <xsd:minInclusive value="0"/>
>         <xsd:maxInclusive value="9999999"/>
>     </xsd:restriction>
> </xsd:simpleType>
> results in the following Java code being generated:
> /**
>  * Auto generated setter method
>  * @param param TariffID
>  */
> public void setTariffID(int param){
>   if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "9999999") <= 0){
>     this.localTariffID=param;
>   }
>   else {
>     throw new java.lang.RuntimeException();
>   }                                       
>   if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "0") >= 0){
>     this.localTariffID=param;
>   }
>   else {
>     throw new java.lang.RuntimeException();
>   }
> }
> I and others on the user mailing list believe this is a bug in the ADB databinding code generation. 

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


[jira] Updated: (AXIS2-4190) WSDL2JAVA Not generating code for when databinding is ADB.

Posted by "Colin Anderson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colin Anderson updated AXIS2-4190:
----------------------------------

    Description: 
I have the following definition in an XSD:

<xsd:simpleType name="tariffID">
    <xsd:annotation>
        <xsd:documentation>Standard tariff ID</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:int">
        <xsd:totalDigits value="7"/>
    </xsd:restriction>
 </xsd:simpleType>

When I generate the Java code I get the TariffID type as expected, but in the generated setTariffID(int) method, there is no code generated that captures the <xsd:totalDigits> restriction:

/**
 * Auto generated setter method
 * @param param TariffID
 */
  public void setTariffID(int param){
    this.localTariffID=param;
  }

If I then add either <xsd:pattern> or <xsd:minInclusive> and <xsd:maxInclusive> to the XSD then these restrictions are captured in the generated code.  For example, this:

<xsd:simpleType name="tariffID">
    <xsd:annotation>
        <xsd:documentation>Standard tariff ID</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:int">
        <xsd:totalDigits value="7"/>
        <xsd:minInclusive value="0"/>
        <xsd:maxInclusive value="9999999"/>
    </xsd:restriction>
</xsd:simpleType>

results in the following Java code being generated:

/**
 * Auto generated setter method
 * @param param TariffID
 */
public void setTariffID(int param){
  if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "9999999") <= 0){

    this.localTariffID=param;
  }
  else {
    throw new java.lang.RuntimeException();
  }                                       
  if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "0") >= 0){
    this.localTariffID=param;
  }
  else {
    throw new java.lang.RuntimeException();
  }
}

I and others on the user mailing list believe this is a bug in the ADB databinding code generation. 

  was:
I have the following definition in an XSD:

<xsd:simpleType name="tariffID">
    <xsd:annotation>
        <xsd:documentation>Standard tariff ID</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:decimal">
        <xsd:totalDigits value="7"/>
    </xsd:restriction>
 </xsd:simpleType>

When I generate the Java code I get the TariffID type as expected, but in the generated setTariffID(int) method, there is no code generated that captures the <xsd:totalDigits> restriction:

/**
 * Auto generated setter method
 * @param param TariffID
 */
  public void setTariffID(int param){
    this.localTariffID=param;
  }

If I then add either <xsd:pattern> or <xsd:minInclusive> and <xsd:maxInclusive> to the XSD then these restrictions are captured in the generated code.  For example, this:

<xsd:simpleType name="tariffID">
    <xsd:annotation>
        <xsd:documentation>Standard tariff ID</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:int">
        <xsd:totalDigits value="7"/>
        <xsd:minInclusive value="0"/>
        <xsd:maxInclusive value="9999999"/>
    </xsd:restriction>
</xsd:simpleType>

results in the following Java code being generated:

/**
 * Auto generated setter method
 * @param param TariffID
 */
public void setTariffID(int param){
  if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "9999999") <= 0){

    this.localTariffID=param;
  }
  else {
    throw new java.lang.RuntimeException();
  }                                       
  if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "0") >= 0){
    this.localTariffID=param;
  }
  else {
    throw new java.lang.RuntimeException();
  }
}

I and others on the user mailing list believe this is a bug in the ADB databinding code generation. 


First XSD definition was incorrect.

> WSDL2JAVA Not generating code for <xsd:totalDigits> when databinding is ADB.
> ----------------------------------------------------------------------------
>
>                 Key: AXIS2-4190
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4190
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb, codegen
>    Affects Versions: 1.4.1, 1.4, 1.3
>         Environment: Any
>            Reporter: Colin Anderson
>
> I have the following definition in an XSD:
> <xsd:simpleType name="tariffID">
>     <xsd:annotation>
>         <xsd:documentation>Standard tariff ID</xsd:documentation>
>     </xsd:annotation>
>     <xsd:restriction base="xsd:int">
>         <xsd:totalDigits value="7"/>
>     </xsd:restriction>
>  </xsd:simpleType>
> When I generate the Java code I get the TariffID type as expected, but in the generated setTariffID(int) method, there is no code generated that captures the <xsd:totalDigits> restriction:
> /**
>  * Auto generated setter method
>  * @param param TariffID
>  */
>   public void setTariffID(int param){
>     this.localTariffID=param;
>   }
> If I then add either <xsd:pattern> or <xsd:minInclusive> and <xsd:maxInclusive> to the XSD then these restrictions are captured in the generated code.  For example, this:
> <xsd:simpleType name="tariffID">
>     <xsd:annotation>
>         <xsd:documentation>Standard tariff ID</xsd:documentation>
>     </xsd:annotation>
>     <xsd:restriction base="xsd:int">
>         <xsd:totalDigits value="7"/>
>         <xsd:minInclusive value="0"/>
>         <xsd:maxInclusive value="9999999"/>
>     </xsd:restriction>
> </xsd:simpleType>
> results in the following Java code being generated:
> /**
>  * Auto generated setter method
>  * @param param TariffID
>  */
> public void setTariffID(int param){
>   if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "9999999") <= 0){
>     this.localTariffID=param;
>   }
>   else {
>     throw new java.lang.RuntimeException();
>   }                                       
>   if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, "0") >= 0){
>     this.localTariffID=param;
>   }
>   else {
>     throw new java.lang.RuntimeException();
>   }
> }
> I and others on the user mailing list believe this is a bug in the ADB databinding code generation. 

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