返回的MembershipUser使用WCF服务MembershipUser、WCF

2023-09-03 08:16:11 作者:~*_*~

我有WCF服务来获取用户的ActiveDirectory中。 我收到的请求(用户名)的参数并建立与响应性的MembershipUser。 从某些原因,连接亲近。 服务操作找到用户,并成功创建了响应。 执行行时:返回响应;我得到了在客户端异常。 异常:基础连接已经关闭:连接被意外关闭 内部异常: 响应=空 状态= 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

谢谢!

推荐答案

我发现使用WCF的跟踪误差。的错误是,XmlSeriazlier不能序列化的MembershipUser,即使它是可序列化的,因为它具有SecurityAttribute太。来源:

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

 
精彩推荐
图片推荐