views:

398

answers:

1

I have a website calling a WCF service and I want the service to run with the browser culture. I am using the service in ASP.NET compatibility mode. This is working so far - It is possible to set the culture of the WCF service using the culture and uiCulture of the globalization section.

My problem is that enableClientBasedCulture shows no effect. These are my globalization settings for the service:

<globalization enableClientBasedCulture="true" culture="auto" uiCulture="auto"/>

The service ignores these settings and uses the default culture.

Something I am missing? Is enableClientBasedCulture the wrong way to transfer the culture in this scenario?

+2  A: 

For WCF services, I use an implementation of WS-I18N similar to this one.

If I've understood your configuration correctly, you have:

  • A browser on the client
  • ... accessing an ASP.NET application on your server
  • ... which calls a WCF service on the same or a different server (maybe in the same server application)

This will work as follows:

  • Browser requests an ASP.NET page.

  • ASP.NET appplication sets its culture to the client culture (enableClientBasedCulture =true)

  • ASP.NET application adds a WS-I18N SOAP header with the current culture when calling the WCF web service.

  • WCF service interprets the WS-I18N SOAP header, and sets its culture while processing the request.

Joe
Your summary of my configuration is mainly correct. The service isn’t on the same server, but I think that doesn’t matter.That’s very interesting, but hard stuff. You mean that I have to implement the culture transfer according to the linked article and there’s no built-in mechanism I just have to activate. Maybe that’s the way to go, but I will wait some time to give the guy with the magic attribute a chance…
Dirk
That's right, there's nothing built-in. I guess we could expect Microsoft to add WS-I18N support to the Framework if and when it makes it's way from Working Draft to a Recommendation. The wheels turn slowly at W3C.
Joe