In my silverlight app I use service reference to wcf service. After I deployed this project to my test IIS, I couldn’t see any .config file where all endpoint information is stored. That ServiceReferences.ClientConfig is packed in xap package. How would I deploy it to customer’s server then? I need a way to configure endpoint there. How do you do that?
Share
Instead of trying to support editing the clientconfig file in the XAP, here is another approach.
Add the web service endpoint address to the Silverlight InitParams in the HTML page that host the Silverlight application. Maybe set the initparams dynamically via ASP.NET. Programatically use this address when creating the client-side service proxy.
Another option is to assume the web service is always in a relative directory to the hosting page. I used something like:
Combining both options works well, if the InitParams are missing, I use a the relative path to the well known location (helpful in deployment/production). If the IntiParams have a endpoint, I use that (helpful in debugging/testing).