Aug 25, 2008 at 6:38 PM
Edited Aug 25, 2008 at 8:53 PM
I couldn’t make it work with the web.config change that eranshalley mentions. And because we have several developers working on the same silverlight project, each with its local server, a test server and a production server, we need
a way to make the service work, regardless of the server and without touching the ServiceReferences.ClientConfig file.
So we modified the Log class on the SilverlightLogging project to store an EndpointAddress object that points to the page point of origin.
But I would be better if there was a way to define at least the endpoint address from the App, when the silverlight program is starting. The LogManager could store it, since already has a couple of static variables.
On the Log constructor we called a method that creates the parameters for the ClogServiceClient:
binding = new System.ServiceModel.BasicHttpBinding();
binding.MaxBufferSize = 2147483647;
binding.MaxReceivedMessageSize = 2147483647;
address = new System.ServiceModel.EndpointAddress(new Uri(Application.Current.Host.Source, "../../ClogService.svc")); //assumes that the service is on root.
And we modified the CreateServiceClient method:
return new ClogServiceClient(binding, address);