0

I'm attempting to generate Java code from a WSDL file. It generates the code but there seems to be an issue with one of the auto generated setter methods.

/**
* Auto generated setter method
* @param param Curr132
*/
public void setCurr132(java.math.BigDecimal param){
  java.lang.String totalDigitsDecimal = org.apache.axis2.databinding.utils.ConverterUtil.convertToStandardDecimalNotation("13").toString();

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

Whenever I create a new Curr132 object and use setCurr132, it throws the RuntimeException.

The problem seems to be the '>'. If I change that to a '<' it works. Is this the correct fix?

MaVRoSCy
  • 17,747
  • 15
  • 82
  • 125
sb89
  • 353
  • 1
  • 6
  • 23

2 Answers2

0

Most Obvious, Don't change the operator rather change the param value, because as per param value, if condition fails. i hope, you aware of what compare method returns. if not look at here. Hence the exception thrown in the else blog.

Karthikeyan
  • 2,634
  • 5
  • 30
  • 51
0

In Java invoke setCurr132() as folllow

java.math.BigDecimal param=new java.math.BigDecimal(3.0E13);
setCurr132(param);

RKS
  • 445
  • 4
  • 14