Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug in PB-WebService regarding the decimal separator?

119 views
Skip to first unread message

tomtom...@gmx.de

unread,
Jun 26, 2008, 12:46:34 PM6/26/08
to
Hi folks,
we have a problem in PB regarding the decimal separator.

We use PB Version 11.2 Build 8542 (English) on Windows XP (GERMAN).
The Webservice is a Java-WebService.

The PB-Application retrieves Data from the Java-WebService via the DOT-
NET-Service-Engine.

XML-Message (from TCPMonitor)
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/
envelope/">
<soap:Body>
<ns1:findFondsKurseResponse xmlns:ns1="http://
webservice.dummy.easi.de/">
<return>
<ns2:FondsKursValue xmlns:ns2="http://
values.dummy.easi.de">
<ns2:fondsPrice>58.57</ns2:fondsPrice>
<ns2:fondsDate>2008-04-04T00:00:00+02:00</
ns2:fondsDate>
</ns2:FondsKursValue>
</return>
</ns1:findFondsKurseResponse>
</soap:Body>
</soap:Envelope>

PB-Code:
...
p_fondskursvalue la_p_fondskursvalue[]

la_p_fondskursvalue = ip_AssetService.findFondsKurse(11)

FOR ll_Cnt = 1 TO upperBound(la_p_fondskursvalue)

Messagebox(String(ll_Cnt),
String(la_p_fondskursvalue[ll_Cnt].fondsPrice))

NEXT
...

In the IDE everything is fine, only the EXE has a big problem:

If the Decimal-Separator is set to "." (dot) the value of fondsPrice
is "58.57" => OK
If the Decimal-Separator is set to "," (comma=> GERMAN decimal
separator) the value of fondsPrice is "5857" => BIG problem

The Decimal-Separator comes from here:
"HKEY_CURRENT_USER\Control Panel\International\sDecimal"

We did:
- Set the Decimal-Separator via RegistrySet() to "." (dot) just before
invoking the WebService ip_AssetService.findFondsKurse()

We dont' want:
- Convert decimal-Values to String and back
- Divide decimal-Values by 100 or something like that

Any ideas to configure DOT.NET? Or PB? Or what ever?

Thanks,
Tom

John Moon

unread,
Jul 5, 2008, 5:56:30 AM7/5/08
to
I had the same problem. I fixed it by using double.

means:
- replace all "decimal" types in wsdl by "double"
- redeploy

tomtom...@gmx.de schrieb:

John Moon

unread,
Jul 5, 2008, 6:08:39 AM7/5/08
to
and .... DONT't try to divide by 100 ... it doesn't work

44,55
4455
4555 / 100
44,55 ... OK

BUT

44,6
446
446 / 100
4,46
4,46 .... FAILED !!!!

John Moon schrieb:

Arnd Schmidt

unread,
Jul 5, 2008, 4:02:58 PM7/5/08
to
Sorry. but I can not understand your mathematics.

Can you explain?

Arnd

Arnd Schmidt

unread,
Jul 5, 2008, 6:11:34 PM7/5/08
to
Is there any chance to change the culture info like explained in

http://msdn.microsoft.com/en-us/library/syy068tk.aspx

Arnd

Benjamin Kemner

unread,
Jul 8, 2008, 5:08:28 AM7/8/08
to
I do

44,55 <-- It,s a german decimal value ... for us 44.55
4455 <-- That's the bug in PB.
The seperator is killed.
That's no prob for us but for german decimals.
4555 / 100 <-- I tried this workaround to get my seperator back
44,55 ... OK <- Ah, that works! .......... for this ;)

BUT!!!!

44,6 <-- see above
446 <-- The seperator is killed ... doesn't matter where it is
446 / 100 <-- Ah, my workaround
4,46 <-- damn, that's not the value of step 1
4,46 .... FAILED !!!! <-- owned


Arnd Schmidt schrieb:


--
kemnerAT_NOSPAMsf-datentechnikDOTde

Benjamin Kemner

unread,
Jul 8, 2008, 5:14:55 AM7/8/08
to
I don't think so. It's definitly a BUG in Powerbuilder.
Like John sad.

Try to replace the decimal datatypes in wsdl by double.

regards

Benjamin

Arnd Schmidt schrieb:


--
kemnerAT_NOSPAMsf-datentechnikDOTde

Paul Horan[TeamSybase]

unread,
Jul 8, 2008, 9:14:26 AM7/8/08
to
I think your arithmetic is still wrong...

> 44,6 <-- see above 446 <-- The seperator is killed ... doesn't matter
> where it is
> 446 / 100 <-- Ah, my workaround 4,46 <-- damn, that's not the value of
> step 1
> 4,46 .... FAILED !!!! <-- owned

44,6 (or 44.6) is not 446 / 100, it's 446 / 10.

Paul Horan[TeamSybase]

"Benjamin Kemner" <lo...@my-signature.de> wrote in message
news:48732e8c@forums-1-dub...

Message has been deleted

Terry Dykstra

unread,
Jul 8, 2008, 4:17:39 PM7/8/08
to
If you are not in the PB 11.5 beta, I suggest you get in.
Either way, please open a case. You can submit bugs through CaseExpress.

--
Terry Dykstra (TeamSybase)
http://powerbuilder.codeXchange.sybase.com/
http://casexpress.sybase.com
product enhancement requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement

<tomtom...@gmx.de> wrote in message
news:c72d7852-4c40-44b0...@m73g2000hsh.googlegroups.com...
> Hi,
> a (genius) colleague found a solution.
>
> It's a NOT simple, but it WORKS.
> (of course ONLY for DOT.NET-WS)
>
> To-Know:
> - You need access to "Visual C# 2008 Express Edition"
> - Somewhere under the directory of <PB-Workspace> is a directory
> "TmpWebService"
> Here you find a temporary C#-File (<WebServiceName>.cs).
> PB respectively DOT.NET use this file to generate the WS-DLL.
> Each time a new WebService is generated, the old <WebServiceName>.cs-
> File is deleted
> - You have to edit the temporary C#-File
> 1. Add in the header:
> namespace WebService
> {
> using System.Diagnostics;
> using System.Web.Services;
> using System.ComponentModel;
> using System.Web.Services.Protocols;
> using System;
> using System.Xml.Serialization;
>
> //ADD START_HEADER
> using System.Reflection;
> using System.Threading;
> using System.IO;
> using System.Globalization;
> using System.Reflection.Emit;
> //ADD ENDE_HEADER
> ...
>
> 2. Add in the Constructor:
> ....
> public ClientService ()
> {
> string urlSetting =
> System.Configuration.ConfigurationManager.AppSettings["EndpointURL"];
> if ((urlSetting != null))
> {
> this.Url = urlSetting;
> }
> else
> {
> this.Url = "http://localhost:8080/easi-ws/services/
> ClientService ";
> }
> //ADD START_Constructor
> System.Globalization.CultureInfo culture =
> System.Globalization.CultureInfo.CreateSpecificCulture("de-DE");
> System.Threading.Thread.CurrentThread.CurrentCulture =
> culture;
> culture.NumberFormat.NumberDecimalSeparator = ".";
> culture.NumberFormat.NumberGroupSeparator = ",";
> //ADD ENDE_Constructor
> }
> ...
> - Build a "Visual C# 2008 Express Edition"-Project for each C#-File
> respectively WebService
>
> Important note:
> We did not have success to edit the <WebServiceName>.cs-File in the
> directory "TmpWebService" .
> We need to use "Visual C# 2008 Express Edition" and build the DLL VIA
> a Visual-C#-Project!
>
> Procedure:
> 1. Delete all WebService-DLL in the Project
> 2. Generate ONE PB-WebService-Proxy from PB
> Copy the generated (temporary) C#-File to a save place
> Goto 1 until all WebService-DLLs are generated
> 3. Edit each C#-File => Add entrys in the the header/Constructor
> 4. Open a Visual-C#-Project for each WebService-DLL
> => Build Solution
> 6. Copy the genenerated WebService-DLL to the PB-WebService-DLL
> directory.
>
> That's all you have to do ;-)
>
> Maybe someone from Sybase can check this and may be
> in PB 11.5 it will be somehow easier to run a german WS-Client.
>
> Thanks,
> Tom


John Moon

unread,
Jul 8, 2008, 6:17:26 PM7/8/08
to
Paul Horan[TeamSybase] wrote:
> I think your arithmetic is still wrong...
sure, but I can't get the RIGHT way

if I get the service 446, there is no way to determine what's the right
source.

Paul Horan[TeamSybase] wrote:
>> 44,6 <-- see above 446 <-- The seperator is killed ... doesn't matter
>> where it is
>> 446 / 100 <-- Ah, my workaround 4,46 <-- damn, that's not the value of
>> step 1
>> 4,46 .... FAILED !!!! <-- owned
>
> 44,6 (or 44.6) is not 446 / 100, it's 446 / 10.

Yes, you are right. But how can I know that the source is 44.6 and NOT
4.46.

That's no workaround. I doesn't work.

regards

John

Message has been deleted
Message has been deleted
Message has been deleted

tomtom...@gmx.de

unread,
Jul 9, 2008, 4:17:38 AM7/9/08
to

We need to use "Visual C# 2008 Express Edition" and build the DLL via
a Visual-C#-Project.

Procedure:
1. Delete all WebService-DLL in the Project
2. Generate ONE PB-WebService-Proxy from PB
Copy the generated (temporary) C#-File to a save place
Goto 1 until all WebService-DLLs are generated
3. Edit each C#-File => Add entrys in the the header/Constructor
4. Open a Visual-C#-Project for each WebService-DLL
=> Build Solution
6. Copy the genenerated WebService-DLL to the PB-WebService-DLL
directory.

That's all you have to do ;-)

There is also an issue regarding DateTime-Fields.
The original PB-WS changed VALUES from YYYY-MM-DD to YYYY-DD-MM.
The DLL generated by Visual C# works also in this case.

Arnd Schmidt

unread,
Jul 9, 2008, 3:17:56 PM7/9/08
to
It think Sybase has noticed since half a year or more about this general "culture info" problem.
It was also discussed in other threads include sybase folks.

I am glad you found a solution follwing my attempt.

http://msdn.microsoft.com/en-us/library/syy068tk.aspx

Arnd

tomtom...@gmx.de

unread,
Jul 9, 2008, 4:18:33 PM7/9/08
to
To be honest: My colleague found the solution by himself.
But we are VERY BUSY at the moment.
So I took some time to find some time to post our way of handle a
german PV-WS-Client ;-)

Anyway, thanks.

Tom

Arnd Schmidt

unread,
Jul 9, 2008, 6:17:49 PM7/9/08
to
Tom,

100 % agreed.

It is a nice workaorund and real good desciption that you posted,

Indeed your collage did a great job to hock into the constructur -
no offend, I really like this.

You posted the solution 5 times without any quotes -
also to the response I gave to your initial posting.
so I implied something wrong.

I am sorry.

Arnd

0 new messages