WCF RIA 通过 Net.TCP 绑定?

发布于 2024-09-15 03:27:14 字数 890 浏览 3 评论 0原文

我正在尝试提高 Silverlight 4 WCF RIA 应用程序的性能。由于它仅供 Intranet 使用,因此我认为从默认的二进制 HTTP 绑定切换到 Net.TCP 绑定可能会稍微提高性能。

然而,我很难运行一个简单的概念验证应用程序。我已经:

  • 将 conecpt 应用程序的证明从 Cassini 切换到 IIS (7)
  • 在 IIS 上添加了适当的绑定并启用了协议
  • 将 clientaccesspolicy.xml 文件添加到我的 IIS 根

现在,当我创建如下上下文时:

var context = new DomainService1(
new Uri(
    "net.tcp://localhost:4502/BusinessApplication/BusinessApplication2.Web/ClientBin/BusinessApplication2-Web-DomainService1.svc"));

... 我得到以下错误:

The provided URI scheme 'net.tcp' is invalid; expected 'http'. Parameter name: via

现在我很困惑。据我所知,问题是由自动生成的 WCF RIA 代码创建的客户端需要被告知它要使用 Net.TCP 端点,但我不确定如何做到这一点。

我找到了大量解释如何通过 Net.TCP 获取 WCF 服务的博客文章,但我没有找到一篇讨论 WCF RIA 的文章,而且我也找不到任何官方文档。所有这些解释都涉及对 web.config 文件的更改,这些更改似乎不适合 WCF RIA 应用程序。

有人可以向我解释一下如何进行此配置,或者向我指出一些文档吗?

I am trying to improve the performance of a Silverlight 4 WCF RIA application. As it's for intranet use only, I figured switching from the default binary HTTP binding to the Net.TCP binding might improve performance a bit.

However, I am having a hard time just getting a simple proof of concept application running. I have:

  • switched the proof of conecpt app from Cassini to IIS (7)
  • added the appropriate bindings and enabled protocols on IIS
  • added a clientaccesspolicy.xml file to my IIS root

Now, when I create a context like so:

var context = new DomainService1(
new Uri(
    "net.tcp://localhost:4502/BusinessApplication/BusinessApplication2.Web/ClientBin/BusinessApplication2-Web-DomainService1.svc"));

... I get the following error:

The provided URI scheme 'net.tcp' is invalid; expected 'http'. Parameter name: via

Now I'm stumped. As far as I can tell, the problem is that the client being created by the auto-generated WCF RIA code needs to be told that it's to use a Net.TCP endpoint, but I'm unsure how to do that.

I've found plenty of blog posts explaining how to get WCF services going over Net.TCP, but I haven't found a single one talking about WCF RIA, and I can't find any offical documentation either. All of those explanations involve changes to the web.config file that seem unsuited to a WCF RIA app.

Could some one please either explain to me how to get this configured, or point me at some documentation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

半世晨晓 2024-09-22 03:27:14

WCF RIA 服务依赖于 HttpContext,而 Net.TCP 绑定不提供该服务。

至于性能问题,您能详细说明一下吗?查询/操作的瓶颈是什么?数据大小是多少(实体大小 x 实体数量)?您的性能要求与当前性能之间的差异是多少?

也许还有其他不涉及Net.TCP的方法?

谢谢。

Dinesh

(WCF RIA 服务项目经理)

WCF RIA Services depends on HttpContext which is not available with Net.TCP binding.

As for perf issues, could you elaborate a bit further? What is the bottleneck query/operation? What is the size of data (entity size x entity count)? What is the delta between your perf requirements and current perf?

Perhaps there are other ways that don't involve Net.TCP?

Thanks.

Dinesh

(WCF RIA Services Program Manager)

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