Hi all,

I got the solution.

If I initial the BigDecimal object with number value for UserNum1 parameter 
like below

Number11_4 userNum1 = new Number11_4();
userNum1.setNumber11_4(new BigDecimal(1.0002));            
header.setUserNum1(userNum1);

Then  the value will be changed to   
1.000199999999999977973175191436894237995147705078125.
 
Whereas when the value for UserNum1 parameter is declared with string, the 
value is correct on web service server.

Number11_4 userNum1 = new Number11_4();
 userNum1.setNumber11_4(new BigDecimal("1.0002"));            
 header.setUserNum1(userNum1);

So, it is BigDecimal class of Java 1.5 bug not Axis2 ADB.

Best regards,

Suriya

Suriya Simsuwat <[EMAIL PROTECTED]> wrote: Hi all,

I have faced the strange problem that in my WSDL file I have xsd:simpleType for 
xsd:decimal element like below (full details of WSDL can be found in the 
attached file). 

<xsd:simpleType name="number11_4">
                <xsd:restriction base="xsd:decimal">
                    <xsd:totalDigits value="11" />
                    <xsd:fractionDigits value="4" />
                </xsd:restriction>
</xsd:simpleType>

After I created a skeleton class, built .aar file, and then deploy it on 
Tomcat. Currently I am using Axis2 version 1.3. 

When I used the client class to call this service by  setting the value as 
1.0002 to UserNum1  parameter which having xsd:decimal type defined in the 
WSDL, the web service server always got this value 
1.000199999999999977973175191436894237995147705078125  instead of 1.0002. It is 
a bug with ADB when it serializes and deserializes xsd:decimal element 
(BigDecimal object).

<ns1:WOLaborTimeRequest
    xmlns:ns1="http://www.test.com/WOLaborTime
Service" name="WOLaborTime"
    business_id="testTH03" create_date="2008-03-26Z" cre
    ate_time="03:19:48.000000866Z" source_reference="G1"
    destination_reference="G2">
    <WOLaborTimeHeader>
        <UserAlpha1>Alpha1</UserAlpha1>
        <UserAlpha2>Alpha2</UserAlpha2>
        <UserAlpha3>Alpha3</UserAlpha3>
         <UserNum1>
            1.000199999999999977973175191436894237995147705078125
        </UserNum1>
        <UserNUm2>2</UserNUm2>
        <UserNum3>3</UserNum3>
        <WOLaborTimeLines>
            <Sequence>0002</Sequence>
            <WorkOrder>TEST</WorkOrder>
            <WorkOrderLine>0001</WorkOrderLine>
            <EmployeeNumber>0123</EmployeeNumber>
             <LaborHours>8</LaborHours>
            <LaborHoursCode>T</LaborHoursCode>
            <LaborHoursType>T</LaborHoursType>
            <LaborShift>T</LaborShift>
            <TransactionDate>2008-03-26Z</TransactionDate>
        </WOLaborTimeLines>
    </WOLaborTimeHeader>
</ns1:WOLaborTimeRequest>
 
Can anyone suggest me how to solve this issue?

Best Regards,

Suriya

        

---------------------------------
Be a better friend, newshound, and  know-it-all with Yahoo! Mobile.  Try it 
now.---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.

Reply via email to