We are building a Silverlight application and have calls to a Silverlight-WCF service. When running the application from Visual Studio everything works perfectly. When we
There are two things that you need to do.
First, provide clientaccesspolicy.xml and/or crossdomain.xml files on the website. This MSDN article has details. I also found this blog entry to be useful.
Second, ensure that your service reference endpoints are pointing to the right URL. For my projects, I have different build configurations (Release, Debug, Test, Beta, etc.) and several endpoints. I then select the appropriate endpoint using #if
directives in my code.
For example:
soapClient =
#if DEBUG
new MySoapClient("DebugService");
#elif TESTRELEASE
new MySoapClient("TestService");
#elif BETA
new MySoapClient("BetaService");
#else
new MySoapClient("ReleaseService");
#endif
This usually happen when the WCF service is deployed in a different domain in respect to the application location. If this is a temporary situation having tboth service and application on the same domain will solve. If it is not possible create a proxy for the remote service on the application could work.