i've made a service reference from my silverlight app to my local dev server. but now i want to deploy this on the testserver, but how can i change the uri of the dataservice now? all i deploy is a XAP file, and in the asp.net world i was used to change the uri in the web.config, but obviously that isn't present in a silverlight app?
Asked
Active
Viewed 213 times
2 Answers
3
See this answer for some details on how to set your WCF proxy end point programmatically. Doing it this way means you can avoid putting any address information in your config file.
0
Your Silverlight application should have merged the ServiceReferences.ClientConfig into your web.config file. You will find it under:
<system.serviceModel>
<bindings>
<!-- Your binding details here -->
</bindings>
<client>
<endpoint address="http://localhost/servicename/servicename.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_Iservicename"
contract="servicenameReference.Iservicename"
name="BasicHttpBinding_Iservicename" />
</client>
</system.serverModel>
Amend the address to point to the production server.

Neil Knight
- 47,437
- 25
- 129
- 188
-
But the web.config is in my web site, and not on the client's computer, is it? So how is the silverlight app in the browser in it's XAP file connecting to the web.config to see the endpoint address? – Michel May 25 '10 at 10:07
-
Correct, the web.config is on the Server which the XAP file talks too. – Neil Knight May 25 '10 at 10:10
-
@Ardman, i think the point is that the Silverlight app hasn't determined where the server is? – slugster May 25 '10 at 10:11