views:

163

answers:

1

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. :-)

A: 

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
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?
Xabatcha
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