Results 1 to 4 of 4

Thread: QT + axis2c

  1. #1
    Join Date
    Oct 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QT + axis2c

    I'm using axis2c to create a webservices client that use message like this :
    Qt Code:
    1. <?xml version="1.0"?>
    2. <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    3. <soap:Header>
    4. </soap:Header>
    5. <soap:Body>
    6. <m:CAS xmlns:m="http://www.example.org/ca">
    7. <m:CA>
    8. <m:Periode>2012-01</m:Periode>
    9. <m:amount>189.23</m:amount>
    10. </m:CA>
    11. <m:CA>
    12. <m:Periode>2012-02</m:Periode>
    13. <m:amount>259.74</m:amount>
    14. </m:CA>
    15. <m:CA>
    16. <m:Periode>2012-03</m:Periode>
    17. <m:amount>895.1</m:amount>
    18. </m:CA>
    19. </m:CAS>
    20. </soap:Body>
    21. </soap:Envelope>
    To copy to clipboard, switch view to plain text mode 

    It work very well, in my console I can see :
    Qt Code:
    1. 2012-01: 189.23
    2. 2012-02: 259.74
    3. 2012-03: 895.10
    To copy to clipboard, switch view to plain text mode 

    When I include my code in Qt, the result :
    Qt Code:
    1. 2012-01: 189,00
    2. 2012-02: 259,00
    3. 2012-03: 895,00
    To copy to clipboard, switch view to plain text mode 

    The decimal symbol was changed and the decimal part has been deleted !

    I think is problem of Locale.

    Does the Qt Locale is different from the System Locale ?

    It is possible to deactive the use of Qt Locale before call my WS ?

    Thank

    Corentin

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: QT + axis2c

    Have you tried the docs?
    QLocale
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Oct 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: QT + axis2c

    I did not read it great ...

    I think a :
    Qt Code:
    1. QLocale::setDefault(QLocale::C);
    To copy to clipboard, switch view to plain text mode 

    In the start of my code will resolve the problem.
    I will try it tomorow.

    Thank

  4. #4
    Join Date
    Oct 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT + axis2c

    Qt Code:
    1. QLocale::setDefault(QLocale::C);
    To copy to clipboard, switch view to plain text mode 
    Don't work !

    The axis2c library is a pure C library, it does not work with QLocale, the C function setlocale must be used instead.
    So I've added this code in the constructor of my class that uses axis2c and everything works fine !
    Qt Code:
    1. setlocale (LC_NUMERIC, "C");
    To copy to clipboard, switch view to plain text mode 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.