Silverlight 客户端使用 WCF 服务 - 生产环境中的配置问题
我们构建了一个使用 WCF 服务的 silverlight 客户端。它在我们的本地开发盒上工作得绝对完美,因为 WCF 服务 + Silverlight 主机应用程序两个项目都在本地主机上运行并且工作正常。
但是,在生产环境中,silverlight 客户端托管在不同的网站中,并且 WCF 服务现在托管在同一 IIS 内的不同站点中。 silverlight应用程序根本无法调用该服务,在该服务上配置WCF诊断后,我们发现该服务根本没有被调用。似乎不知何故,WCF 服务的端点(生产环境)需要在 silverlight 中更新,但似乎没有明确的方法来更新 Silverlight 中的端点。
有什么想法吗?
We have built a silverlight client consuming a WCF service. it works absolutely perfect on our local dev boxes since both the projects WCF service + Silverlight Host App are running on Localhost and work fine.
However, in Production environment, silverlight client is hosted in a different Website and the WCF service is now hosted in a different site within the same IIS. The silverlight app is not able to invoke the service at all and after configuring WCF diagnostics on the service, we found that the service is not called at all. It seems that somehow, the endpoint (production environment) for WCF service needs to be updated in the silverlight but there does not seems to be a clear way of updating the end point in Silverlight.
Any ideas ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Silverlight 端服务客户端是通过多个构造函数生成的:其中之一采用
Uri
参数。使用该构造函数,传入适合生产环境的Uri
。 (您现在可能正在使用的默认构造函数是硬编码的,以便在开发过程中添加服务时使用该服务的 uri。)The Silverlight-side service client is generated with several constructors: one of them takes a
Uri
parameter. Use that constructor, passing in theUri
that's appropriate for the production environment. (The default constructor, which you're probably using now, is hard-coded to use the uri of the service when it was added during development.)