Bah... this proved tougher than I originally thought, because all I could find were bunch of smart-ass comments that contained no code. You'll hopefully evade that path by following these steps:
1. Download Solution from -> http://www.sendspace.com/file/465sb6[^] 2. Open .sln, press F5 -> press Button -> you should get dialog with bunch of variables showing that server is aware of calling client's credentials and culture 3. Open SilverlightWcf/Page.xaml.cs to see how calls are initialized - note that you only set culture/username/password during proxy's creation.
How to import this into your solution? Easy:
1. Copy Util.CustomHeader.Silverlight & Util.CustomHeader.WcfService projects into your solution's folder 2. Reference Util.CustomHeaders.Silverlight from your Silverlight project, Util.CustomHeaders.WcfService from your WCF project 3. Decorate your WCF service with [CustomHeadersBehaviorAttribute] attribute (alternatively you can set this in config by using CustomHeadersBehavior, see ref #3 for more details) 4. Add reference to your WCF service from Silverlight project and after proxy class generation is finished you'll use code like this to initialize your service:
ClientChannelBinding binding = new ClientChannelBinding();
ClientChannelBinding.Culture = "sr-Latn-CS";
ClientChannelBinding.Username = "username";
ClientChannelBinding.Password = "password";
EndpointAddress endpoint = new EndpointAddress(
client = new SilverlightWcf.ServiceReference1.Service1Client(binding, endpoint);
client.GetDataCompleted += client_GetDataCompleted;
private ServiceReference1.Service1Client client;
Of course, I recommend that you create some kind of WebServiceFactory.cs in your Silverlight project that will create services for you and do this initialization... while also exposing that web service URI in some config.
For those interested in details of how this works: