My problem resembles this question but is not exactly the same: http://stackoverflow.com/questions/1460063/change-culture-when-deserializing-wcf-service
I have built a WCF (web) service running on Windows 7 (IIS 7.5) using VS 2008. One of the properties in my webservice is typed as a System.Double. When building my own client for testing the service, Visual Studio requiers my to write - for example - a number like 123.4 (using a dot as the decimal point). But when using WcfTestClient.exe to access the service and entering a number on the field (like 123.4, still using a dot) it gives me the message "123.4 the is not a valid value for this type". I should mention I live in Sweden and comma is the culture-specific decimal point symbol here.
If I instead use a comma (,) as the decimal point when using WcfTestClient, that is accepted. The problem is that when I debug my webservice code I can see that the comma gets removed by the serializing process somehow and the number has been changed to 1234. Not good.
In my dev environment I have both the service and client running on the same machine. The webservice is running under the NetworkService account which uses the same locale.
My question is: how do I in WCF make sure that whatever number that's supplied on this field/property to the webservice, if containing a comma the comma should NOT be stripped away?
I thought this was automatically handled in the framework. I don´t really care if the number is stored with a comma or a dot as long as the value stays the same.
I am using the DataContractSerializer and auto-implemented properties, like this: [DataMember] public double Price { get; set; }
I've also tested building a property using Convert.ToDouble(value, System.Globalization.CultureInfo.InvariantCulture)
in the setter with no visible change in outcome in the WCF Service.