Description
If you have a element like
<xsd:simpleType name="abc">
<xsd:restriction base="xsd:integer">
<xsd:totalDigits value="5" />
</xsd:restriction>
</xsd:simpleType>
axis generates this as source code
public void setAbc(java.math.BigInteger param){
java.lang.String totalDigitsDecimal = org.apache.axis2.databinding.utils.ConverterUtil.convertToStandardDecimalNotation("5").toString();
if (org.apache.axis2.databinding.utils.ConverterUtil.compare(param, totalDigitsDecimal) > 0)
else
{ throw new java.lang.RuntimeException(); }}
The problem is the toString() of the result from .convertToStandardDecimalNotation("5"). It converts the a BigDecimal into String and this results in "10000.0". Then ConverterUtil.compare() trys to convert this string into a Long. BANG.
Please change convertToStandardDecimalNotation().toString() into convertToStandardDecimalNotation().toPlainString().
The same functionality should be evaluated for xsd:int, xsd:float, xsd:decimal ...
IMHO, this results from a bad implementation of AXIS2-4190. Please add testcases for this.
Take a look at the following comment and below.
Attachments
Issue Links
- Blocked
-
AXIS2-5789 Generated code for xsd:totalDigits throws NumberFormatException
- Resolved
- duplicates
-
AXIS2-4190 WSDL2JAVA Not generating code for <xsd:totalDigits> when databinding is ADB.
- Resolved
- is related to
-
AXIS2-5842 wsdl2java generates faulty runtime code for <xsd:totalDigits>
- Closed
java.lang.String totalDigitsDecimal = org.apache.axis2.databinding.utils.ConverterUtil.convertToStandardDecimalNotation("5").toString();
1.6.3 have not resoled this problem now.
you could try it again.
convertToStandardDecimalNotation().toString() into convertToStandardDecimalNotation().toPlainString().
did not help to this issue.
results is in "10000.0" yet.
I think we need a results is 10000.
but if the number like 13 not the 5 , it is work.results is in "10000000000000"
i wish it will help you.