使用 WCF 服务返回 MembershipUser
我有 WCF 服务从 ActiveDirectory 获取用户。 我从请求(用户名)接收参数并使用 MembershipUser 属性创建响应。 由于某种原因,联系变得紧密。 服务操作找到用户并成功创建响应。 执行行时:“返回响应;” 我在客户端遇到异常。 异常:底层连接已关闭:连接意外关闭 内部异常: 响应=空 Status = System.Net.WebExceptionStatus.ConnectionClosed
谢谢!
I have WCF service to get users from the ActiveDirectory.
I receive parameter from the request (user name) and create response with MembershipUser property.
from some reason, the connection get close.
the service operation find the user and create the response successfully.
when executing the row: "return response;" i got exception on the client side.
exception:The underlying connection was closed: The connection was closed unexpectedly
inner exception:
Response = null
Status = System.Net.WebExceptionStatus.ConnectionClosed
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
打开 WCF 诊断跟踪以查看导致连接关闭的错误。 它可能源自客户端或服务,因此您必须为双方都打开它。
如何开启追踪:
http://msdn.microsoft.com/en-us/library/ms733025.aspx
使用服务跟踪查看器读取跟踪日志:
http://msdn.microsoft.com/en-us/库/aa751795(VS.85).aspx
Turn on WCF diagnostic tracing to see the error that is causing the connection to be closed. It could originate on the client or the service, so you'll have to turn it on for both sides.
How to turn on tracing:
http://msdn.microsoft.com/en-us/library/ms733025.aspx
Using the Service Trace Viewer to read trace logs:
http://msdn.microsoft.com/en-us/library/aa751795(VS.85).aspx
我使用 WCF 跟踪发现了错误。 错误是 XmlSeriazlier 无法序列化 MembershipUser,即使它是可序列化的,因为它也具有 SecurityAttribute。 来源:
http://support.microsoft.com/kb/326971
i found the error using the WCF trace. the error was that the XmlSeriazlier couldn't serialize the MembershipUser even though it was serializable because it has SecurityAttribute too. source:
http://support.microsoft.com/kb/326971