0

I am looking for some solution how I could easily set the requested Culture at client and get it on server. So I would get for example return error message in requested language.
Is there way to set it on WebRequest or WebMethod?

Any suggestion most welcome. Thanks X.

Edit: Finally I used Soap header to carry cultureinfo setting from client to server. Which is fine I suppose. I was just more hoping that it could be set at lower level and not by using customization of SoapHeader. Anyway it works. :-)

Jaroslav Urban
  • 1,269
  • 3
  • 20
  • 32

1 Answers1

2

You could pass the desired culture as a parameter and set the culture at server side with:

Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang); 
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang); 
Jordi
  • 551
  • 2
  • 6
  • 19
  • th, however that is not what I am looking for. I am familiar with how to set the culture. I am more consider about way how to transport this information between client and server. So what did you mean by pass it as a parameter? – Jaroslav Urban Jun 16 '09 at 10:21
  • You can pass it as a parameter to all of the relevant operations, or you can pass it in a SOAP Header that is used by all of the operations that require the culture. – John Saunders Jun 17 '09 at 02:55