IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

pub.string.NumericFormat

  • 1.  pub.string.NumericFormat

    Posted Fri July 06, 2007 03:36 PM

    Hi,

    I’m having some trouble with this built-in service,
    when i set the input like
    num = 12.34
    pattern ###.##

    The output is 12,34

    I was expecting a . as numeric separator

    I found that the locale variable from java for numeric separation is ,
    (getDecimalSeparator)
    wM 6.5 IS SP2 is starting as a service,
    OS is MS Server 2003 with a french user

    How can I configure the numeric separator
    in order to obtain 12.34 as a result from NumericFormat ?

    can you help me ?

    Thanks


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: pub.string.NumericFormat

    Posted Fri July 06, 2007 05:37 PM

    am checked numericFormat, with your inputs
    num = 12.34
    pattern ###.##

    Its giving currect output → 12.34, and i am using 6.5

    Can you cross check again?

    Thanks & Regards,
    ArulChristhuraj. A


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: pub.string.NumericFormat

    Posted Fri July 06, 2007 08:37 PM

    Thanks for your answer,

    I already double check :wink:
    I think it deals with the Locale used by webMethods

    If you could retrieve the Locale you are currently using
    public static Locale getDefault()
    and retrieve the decimal Separator from
    DecimalFormatSymbols.getDecimalSeparator()
    you should obtain a .
    When I run a java service like this, I have a ,


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: pub.string.NumericFormat

    Posted Fri July 06, 2007 09:50 PM

    What locale is set in the operating system you are using? In Windows you do this in Control Panel - Region and Language Settings.

    Mark


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 5.  RE: pub.string.NumericFormat

    Posted Fri July 06, 2007 11:21 PM

    Hi,

    Regional setting are all in french (date, time and numeric)


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 6.  RE: pub.string.NumericFormat

    Posted Fri July 06, 2007 11:49 PM

    Do you want to override the locale-specific settings only for this built-in service or for eveything in IS that is locale-aware?

    You can modify the command that starts java in your server.bat file to pass in the properties to set the locale to something other than the French locale that is set at the OS-level, but I’m not quite sure what you’re really attempting to accomplish.

    java -Duser.language=en -Duser.country=US ... [I]<rest of java command line>[/i]

    Mark


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 7.  RE: pub.string.NumericFormat

    Posted Mon July 09, 2007 09:29 AM

    Thanks for your reply.

    I think I already tried this last week
    but i’ll try again tomorrow this two.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 8.  RE: pub.string.NumericFormat

    Posted Tue July 10, 2007 09:24 AM

    Hi,

    I just tried to add this two options in server.bat

    %JAVA_RUN% -DWM_HOME="%WM_HOME" -Duser.language=en -Duser.region=US ...

    doesn’t change anything,
    I’m keeping the same behaviour on numericFormat ,
    and my test service always returns fr and , as Locale.getDefault().getLanguage() and DecimalFormatSymbols.getDecimalSeparator()

    I’m start IS as a service on a W. Server 2003
    IS using his own jvm 1.4.2_07

    Thanks again for your help


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 9.  RE: pub.string.NumericFormat

    Posted Tue July 10, 2007 01:58 PM

    Sounds like the NT service may not be picking up the changes to your server.bat. Can you try this again when starting IS from the command line?

    If those props are being read then your getLanaguage(), getCountry() and getDecimalSeparator() should no longer return the default values read from your OS locale settings. Since those settings still show their default values, the props are not being picked up.

    Mark


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 10.  RE: pub.string.NumericFormat

    Posted Tue July 10, 2007 04:56 PM

    If IS is restarted using the Restart button in Administrator, then changes to the settings in the .bat are not picked up.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 11.  RE: pub.string.NumericFormat

    Posted Wed July 11, 2007 01:01 PM

    Thanks Rob for this advice

    Mark, you’re right,

    when I start the IS using command line, it’ OK
    my test service return en and .
    and NumericFormat return 12.34
    but when I use the service, it doesn’t take the properties
    keeping fr and , and 12,34

    For test server it’s OK to start from the command line,
    but for the production server it’ll not be possible
    How should I configure the service under windows ?


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 12.  RE: pub.string.NumericFormat

    Posted Wed July 11, 2007 01:03 PM

    You probably need to recreate the NT Service for IS. There is a batch file in the \bin folder that can be used to remove the old one and create the new one with new parameters. Pretty sure this is covered in the Administrator’s guide, but its been awhile since I looked for this info.

    Mark


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 13.  RE: pub.string.NumericFormat

    Posted Wed July 11, 2007 01:27 PM

    I just tried uninstalling the service (installSvc.bat unreg)
    and re installing it using installSvc.bat

    the new one doesn’t take the properties


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 14.  RE: pub.string.NumericFormat

    Posted Wed July 11, 2007 05:41 PM

    Try the SaveSvcParams.bat file instead.

    Usage: SaveSvcParams /classpath <Java classpath> 
    /jvm <JVM root directory> /binpath <path>  
    /jvmargs <JVM arguments> /progargs <program arguments> 
    /svcname <service name>

    That utility does not appear to be documented in the IS Administrator’s guide or the Installation Guide and searching for it on Advantage turns up zero hits. Go figure.

    Mark


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 15.  RE: pub.string.NumericFormat

    Posted Thu July 12, 2007 02:58 PM

    Thank you very much,

    I didn’t try SaveSvcParams directly
    but
    SaveSvcParams is used by server.bat when starting IS as a service
    it takes %JAVA2_MEMSET% in /jvmargs

    by adding -Duser.language=en -Duser.region=US in JAVA2_MEMSET
    I was able to start in english the IS service

    Thanks


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods