You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Franz Fehringer (JIRA)" <ax...@ws.apache.org> on 2007/01/19 14:02:30 UTC

[jira] Created: (AXISCPP-1014) incorrect handling of xsd:decimal due to missing code

incorrect handling of xsd:decimal due to missing code
-----------------------------------------------------

                 Key: AXISCPP-1014
                 URL: https://issues.apache.org/jira/browse/AXISCPP-1014
             Project: Axis-C++
          Issue Type: Bug
          Components: XSD Types
    Affects Versions: current (nightly)
         Environment: WIN2KSP4 VC6SP6 JDK1.5.0_07
            Reporter: Franz Fehringer
            Priority: Minor
             Fix For:  1.6 Final


I want to point out a problem regarding xsd:decimal.
I have a datatype, which is a restriction of xsd:decimal with restrictions

<xsd:maxExclusive value="100000"/>
 <xsd:fractionDigits value="2"/>
 <xsd:minInclusive value="0"/>

There is Java Code (in the generator) for reading/interpreting these restrictions and there is C++ Code (in the axis library code) for handling these restrictions.
But what is completely missing is the intermediate layer, i.e. Java code which generates C++ code for correct initialization of the pertaining struct members.
Therefore in sending xsd:decimals the fractionDigits are always six, which is not suited for e.g. monetary values.
I hacked around this with replacing (in the XSD) xsd:decimal by xsd:double (for xsd:double %g is used instead of %f).
Another hack would be to directly replace (in the library code) %f by %g.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Re: [jira] Commented: (AXISCPP-1014) incorrect handling of xsd:decimal due to missing code

Posted by Franz Fehringer <fe...@isogmbh.de>.
Hello Nadir,

The Axis serializing code contains snippets for correctly serializing 
decimals thus obeying xsd:totalDigits and xsd:fractionDigits.
For example (Decimal.cpp)

    FractionDigits* fractionDigits = getFractionDigits();
    if (fractionDigits->isSet())
    {
        formatSpecifier += ".";
        AxisChar digits[100];
        AxisSprintf (digits, 10, "%i", fractionDigits->getFractionDigits());
        formatSpecifier += digits;
    }

The missing part is (among others) here

FractionDigits* Decimal::getFractionDigits()
{
    return new FractionDigits();
}

So the if block is never entered.
But perhaps the full solution of this problem would be too much effort 
and also %g would be sufficient for my practical purposes.

Greetings

Franz


Nadir Amra schrieb:
> Franz, What do you think is the proper way of handling this?
>
> Nadir K. Amra
>
>
> Franz Fehringer <fe...@isogmbh.de> wrote on 04/23/2007 03:08:39 AM:
>
>   
>> Hello Nadir,
>>
>> To me this is a hack, but better than no solution.
>>
>> Cheers
>>
>> Franz
>>
>>
>> nadir amra (JIRA) schrieb: 
>>     [ https://issues.apache.org/jira/browse/AXISCPP-1014?page=com.
>>
>>     
> atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490498] 
>
>   
>> nadir amra commented on AXISCPP-1014:
>> -------------------------------------
>>
>> If %g is used, then "123.00" would be returned as "123", which I 
>> guess is better than "123.000000".  The question is whether that is OK? 
>>
>>
>>
>>
>> incorrect handling of xsd:decimal due to missing code
>> -----------------------------------------------------
>>
>>                 Key: AXISCPP-1014
>>                 URL: https://issues.apache.org/jira/browse/AXISCPP-1014
>>             Project: Axis-C++
>>          Issue Type: Bug
>>          Components: XSD Types
>>    Affects Versions: current (nightly)
>>         Environment: WIN2KSP4 VC6SP6 JDK1.5.0_07
>>            Reporter: Franz Fehringer
>>         Assigned To: nadir amra
>>            Priority: Minor
>>             Fix For:  1.6 Final
>>
>>
>> I want to point out a problem regarding xsd:decimal.
>> I have a datatype, which is a restriction of xsd:decimal with 
>>     
> restrictions
>   
>> <xsd:maxExclusive value="100000"/>
>>  <xsd:fractionDigits value="2"/>
>>  <xsd:minInclusive value="0"/>
>> There is Java Code (in the generator) for reading/interpreting these
>> restrictions and there is C++ Code (in the axis library code) for 
>> handling these restrictions.
>> But what is completely missing is the intermediate layer, i.e. Java 
>> code which generates C++ code for correct initialization of the 
>> pertaining struct members.
>> Therefore in sending xsd:decimals the fractionDigits are always six,
>> which is not suited for e.g. monetary values.
>> I hacked around this with replacing (in the XSD) xsd:decimal by xsd:
>> double (for xsd:double %g is used instead of %f).
>> Another hack would be to directly replace (in the library code) %f by 
>>     
> %g.
>   
>>
>>
>>     
>
>   
>> -- 
>> Dr. Franz Fehringer (Dipl. Math.)
>> Projektleiter Touristik-Systeme
>> ____________________________________
>> ISO Software Systeme GmbH
>> Eichendorffstrasse 29
>> 90491 N�rnberg
>> Germany
>>
>> Tel.: +49/(911) - 99594-0
>>
>> mailto:Franz.Fehringer@isogmbh.de
>> http://www.isogmbh.de
>>
>> Amtsgericht N�rnberg HRB 18299
>> Gesch�ftsf�hrer: Dipl.-Inform., Dipl.-Kaufm. Harald Goeb
>> Sitz: N�rnberg
>>
>> [attachment "feh.vcf" deleted by Nadir Amra/Rochester/IBM] 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
>   


-- 
Dr. Franz Fehringer (Dipl. Math.)
Projektleiter Touristik-Systeme
____________________________________
ISO Software Systeme GmbH
Eichendorffstrasse 29
90491 N�rnberg
Germany

Tel.: +49/(911) - 99594-0

mailto:Franz.Fehringer@isogmbh.de
http://www.isogmbh.de

Amtsgericht N�rnberg HRB 18299
Gesch�ftsf�hrer: Dipl.-Inform., Dipl.-Kaufm. Harald Goeb
Sitz: N�rnberg



Re: [jira] Commented: (AXISCPP-1014) incorrect handling of xsd:decimal due to missing code

Posted by Nadir Amra <am...@us.ibm.com>.
Franz, What do you think is the proper way of handling this?

Nadir K. Amra


Franz Fehringer <fe...@isogmbh.de> wrote on 04/23/2007 03:08:39 AM:

> Hello Nadir,
> 
> To me this is a hack, but better than no solution.
> 
> Cheers
> 
> Franz
> 
> 
> nadir amra (JIRA) schrieb: 
>     [ https://issues.apache.org/jira/browse/AXISCPP-1014?page=com.
> 
atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490498] 

> 
> nadir amra commented on AXISCPP-1014:
> -------------------------------------
> 
> If %g is used, then "123.00" would be returned as "123", which I 
> guess is better than "123.000000".  The question is whether that is OK? 
> 
> 
> 
> 
> incorrect handling of xsd:decimal due to missing code
> -----------------------------------------------------
> 
>                 Key: AXISCPP-1014
>                 URL: https://issues.apache.org/jira/browse/AXISCPP-1014
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: XSD Types
>    Affects Versions: current (nightly)
>         Environment: WIN2KSP4 VC6SP6 JDK1.5.0_07
>            Reporter: Franz Fehringer
>         Assigned To: nadir amra
>            Priority: Minor
>             Fix For:  1.6 Final
> 
> 
> I want to point out a problem regarding xsd:decimal.
> I have a datatype, which is a restriction of xsd:decimal with 
restrictions
> <xsd:maxExclusive value="100000"/>
>  <xsd:fractionDigits value="2"/>
>  <xsd:minInclusive value="0"/>
> There is Java Code (in the generator) for reading/interpreting these
> restrictions and there is C++ Code (in the axis library code) for 
> handling these restrictions.
> But what is completely missing is the intermediate layer, i.e. Java 
> code which generates C++ code for correct initialization of the 
> pertaining struct members.
> Therefore in sending xsd:decimals the fractionDigits are always six,
> which is not suited for e.g. monetary values.
> I hacked around this with replacing (in the XSD) xsd:decimal by xsd:
> double (for xsd:double %g is used instead of %f).
> Another hack would be to directly replace (in the library code) %f by 
%g.
> 
> 
> 
> 

> -- 
> Dr. Franz Fehringer (Dipl. Math.)
> Projektleiter Touristik-Systeme
> ____________________________________
> ISO Software Systeme GmbH
> Eichendorffstrasse 29
> 90491 Nürnberg
> Germany
> 
> Tel.: +49/(911) - 99594-0
> 
> mailto:Franz.Fehringer@isogmbh.de
> http://www.isogmbh.de
> 
> Amtsgericht Nürnberg HRB 18299
> Geschäftsführer: Dipl.-Inform., Dipl.-Kaufm. Harald Goeb
> Sitz: Nürnberg
> 
> [attachment "feh.vcf" deleted by Nadir Amra/Rochester/IBM] 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org

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


Re: [jira] Commented: (AXISCPP-1014) incorrect handling of xsd:decimal due to missing code

Posted by Franz Fehringer <fe...@isogmbh.de>.
Hello Nadir,

To me this is a hack, but better than no solution.

Cheers

Franz


nadir amra (JIRA) schrieb:
>     [ https://issues.apache.org/jira/browse/AXISCPP-1014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490498 ] 
>
> nadir amra commented on AXISCPP-1014:
> -------------------------------------
>
> If %g is used, then "123.00" would be returned as "123", which I guess is better than "123.000000".  The question is whether that is OK? 
>
>  
>
>   
>> incorrect handling of xsd:decimal due to missing code
>> -----------------------------------------------------
>>
>>                 Key: AXISCPP-1014
>>                 URL: https://issues.apache.org/jira/browse/AXISCPP-1014
>>             Project: Axis-C++
>>          Issue Type: Bug
>>          Components: XSD Types
>>    Affects Versions: current (nightly)
>>         Environment: WIN2KSP4 VC6SP6 JDK1.5.0_07
>>            Reporter: Franz Fehringer
>>         Assigned To: nadir amra
>>            Priority: Minor
>>             Fix For:  1.6 Final
>>
>>
>> I want to point out a problem regarding xsd:decimal.
>> I have a datatype, which is a restriction of xsd:decimal with restrictions
>> <xsd:maxExclusive value="100000"/>
>>  <xsd:fractionDigits value="2"/>
>>  <xsd:minInclusive value="0"/>
>> There is Java Code (in the generator) for reading/interpreting these restrictions and there is C++ Code (in the axis library code) for handling these restrictions.
>> But what is completely missing is the intermediate layer, i.e. Java code which generates C++ code for correct initialization of the pertaining struct members.
>> Therefore in sending xsd:decimals the fractionDigits are always six, which is not suited for e.g. monetary values.
>> I hacked around this with replacing (in the XSD) xsd:decimal by xsd:double (for xsd:double %g is used instead of %f).
>> Another hack would be to directly replace (in the library code) %f by %g.
>>     
>
>   


-- 
Dr. Franz Fehringer (Dipl. Math.)
Projektleiter Touristik-Systeme
____________________________________
ISO Software Systeme GmbH
Eichendorffstrasse 29
90491 Nürnberg
Germany

Tel.: +49/(911) - 99594-0

mailto:Franz.Fehringer@isogmbh.de
http://www.isogmbh.de

Amtsgericht Nürnberg HRB 18299
Geschäftsführer: Dipl.-Inform., Dipl.-Kaufm. Harald Goeb
Sitz: Nürnberg



[jira] Commented: (AXISCPP-1014) incorrect handling of xsd:decimal due to missing code

Posted by "nadir amra (JIRA)" <ax...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/AXISCPP-1014?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490498 ] 

nadir amra commented on AXISCPP-1014:
-------------------------------------

If %g is used, then "123.00" would be returned as "123", which I guess is better than "123.000000".  The question is whether that is OK? 

 

> incorrect handling of xsd:decimal due to missing code
> -----------------------------------------------------
>
>                 Key: AXISCPP-1014
>                 URL: https://issues.apache.org/jira/browse/AXISCPP-1014
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: XSD Types
>    Affects Versions: current (nightly)
>         Environment: WIN2KSP4 VC6SP6 JDK1.5.0_07
>            Reporter: Franz Fehringer
>         Assigned To: nadir amra
>            Priority: Minor
>             Fix For:  1.6 Final
>
>
> I want to point out a problem regarding xsd:decimal.
> I have a datatype, which is a restriction of xsd:decimal with restrictions
> <xsd:maxExclusive value="100000"/>
>  <xsd:fractionDigits value="2"/>
>  <xsd:minInclusive value="0"/>
> There is Java Code (in the generator) for reading/interpreting these restrictions and there is C++ Code (in the axis library code) for handling these restrictions.
> But what is completely missing is the intermediate layer, i.e. Java code which generates C++ code for correct initialization of the pertaining struct members.
> Therefore in sending xsd:decimals the fractionDigits are always six, which is not suited for e.g. monetary values.
> I hacked around this with replacing (in the XSD) xsd:decimal by xsd:double (for xsd:double %g is used instead of %f).
> Another hack would be to directly replace (in the library code) %f by %g.

-- 
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-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Assigned: (AXISCPP-1014) incorrect handling of xsd:decimal due to missing code

Posted by "nadir amra (JIRA)" <ax...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/AXISCPP-1014?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nadir amra reassigned AXISCPP-1014:
-----------------------------------

    Assignee: nadir amra

> incorrect handling of xsd:decimal due to missing code
> -----------------------------------------------------
>
>                 Key: AXISCPP-1014
>                 URL: https://issues.apache.org/jira/browse/AXISCPP-1014
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: XSD Types
>    Affects Versions: current (nightly)
>         Environment: WIN2KSP4 VC6SP6 JDK1.5.0_07
>            Reporter: Franz Fehringer
>         Assigned To: nadir amra
>            Priority: Minor
>             Fix For:  1.6 Final
>
>
> I want to point out a problem regarding xsd:decimal.
> I have a datatype, which is a restriction of xsd:decimal with restrictions
> <xsd:maxExclusive value="100000"/>
>  <xsd:fractionDigits value="2"/>
>  <xsd:minInclusive value="0"/>
> There is Java Code (in the generator) for reading/interpreting these restrictions and there is C++ Code (in the axis library code) for handling these restrictions.
> But what is completely missing is the intermediate layer, i.e. Java code which generates C++ code for correct initialization of the pertaining struct members.
> Therefore in sending xsd:decimals the fractionDigits are always six, which is not suited for e.g. monetary values.
> I hacked around this with replacing (in the XSD) xsd:decimal by xsd:double (for xsd:double %g is used instead of %f).
> Another hack would be to directly replace (in the library code) %f by %g.

-- 
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-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org