Ronnie
Ronnie

Reputation: 670

WCF Web Service Internationalization NumberFormat and DateFormat

I am trying to decide on the correct way to deal with internationalization in a wcf web service, specifically pertaining to the Numeric Format and the Date Format. My service will support multiple languages and cultures. My question is how we should handle input and output serialization for the different Date and Number formats.

  1. For Dates, I am thinking I will just expect that they be submitted and returned as UTC. To me this seems reasonable and a developer say in the Netherlands, should be able to deal with this format.

  2. My other concern is with numeric types, specifically decimals. I am using the xsd:decimal data type, which uses the "." character as the decimal separator. I am wondering if this will be a problem for say a Dutch developer where they use the "," instead of the "." as the decimal separator.

I am not returning any translated text, so that is not a concern. I just want to make sure that returning and accepting a standard numeric and date format, is the right thing to do. As I am not an international developer, I am having hard time putting myself in their shoes.

Any help is appreciated.

Upvotes: 1

Views: 397

Answers (1)

Sixto Saez
Sixto Saez

Reputation: 12680

If possible, I'd make the WCF service work with value types (numerics & date/time) in a culture agnostic manner. Since the XSD standard defines decimal using a period character for the decimal separator, it should be the responsibility of the client software to deserialize it and apply any culture specific formatting. The same should apply for date/time serialization except that time should be UTC as you point out.

Upvotes: 1

Related Questions