Silverlight 客户端使用 WCF 服务 - 生产环境中的配置问题

发布于 2024-10-21 01:00:06 字数 327 浏览 8 评论 0原文

我们构建了一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别想她 2024-10-28 01:00:06

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 the Uri 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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文