WCF无效操作异常
我在使用 wcf 服务时遇到这个奇怪的问题 L2SQL DAL。 服务器托管在本地主机上并包含相应接口的实现。客户端熟悉该接口,偶尔会使用 TCP 传输通过公开的服务查询数据库。 当客户端在本地运行时,一切都很好。 但是,每当客户端在另一台计算机上运行时,System.Data.dll 中就会引发“InvalidOperationException”(传输仍然会被传递),并且随着时间的推移,通道会进入“故障”状态(并且传输无法传递)。 我觉得我的申请中缺少一些非常基本的东西。 有人可以指出这种奇怪行为的可能原因吗?
I encounter this strange problem while using wcf services along with
L2SQL DAL.
The server is hosted at the localhost and contains an implementation of the correspondent interface. The client is familiar with the interface and occasionally queries the database via the exposed service using tcp transport.
When client runs locally everything's just fine.
But whenever client runs at another machine the 'InvalidOperationException' is thrown in the System.Data.dll (the transport still gets delivered) and over the time the channel enters 'Faulted' state(and transport fails to get delivered).
I feel I'm missing something very basic in my application.
Could anyone please point out possible reasons for such and odd behaviour?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果没有正确清理,服务中的异常将导致通道进入故障状态。请参阅:http://bloggingabout。 net/blogs/erwyn/archive/2006/12/09/WCF-Service-Proxy-Helper.aspx
了解如何在服务失败时清理代理。
关于 L2SQL 的问题,看起来您已经找到了解决方案。
An exception in the service will cause the channel to enter a Faulted state, if you do not clean up properly. See: http://bloggingabout.net/blogs/erwyn/archive/2006/12/09/WCF-Service-Proxy-Helper.aspx
for how to clean up the proxy when the service fails.
On your problem with L2SQL, looks like you allready found a solution.