I have a Silverlight 5 application that is obtain data from a Silverlight-enabled WCF service in another project (my solution has a Silverlight project and a web project). There are a number of similar posts, but they're referring to web services hosted on a web server (proper web services).
I am aware that I have to tell the application where to find the service in both dev and prod. In dev, you'll have a port typically. My code to create a service client (with the correct EndpointAddress) is as such:
BasicHttpBinding binding = new BasicHttpBinding(
Application.Current.Host.Source.Scheme.Equals("https", StringComparison.InvariantCultureIgnoreCase)
? BasicHttpSecurityMode.Transport : BasicHttpSecurityMode.None);
binding.MaxReceivedMessageSize = int.MaxValue;
binding.MaxBufferSize = int.MaxValue;
Uri tempUri = new Uri("../PolicyDataService.svc", UriKind.Relative);
EndpointAddress servAddr = new EndpointAddress(tempUri);
PolicyDataServiceClient temp = new PolicyDataServiceClient("BasicHttpBinding_PolicyDataService", servAddr);
return temp;
Now, where am I going wrong? In dev, everything works fine, but in prod the service is never being called. Thanks!