views:

408

answers:

2

Hi all, 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!

+3  A: 

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

Anderson Imes
Was tracing helpful in finding this error? If so, mark this as an answer. If not, please post your methodology for identifying the issue for others to take advantage of.
Anderson Imes
A: 

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

Tamir
If you found it using tracing, why not mark my answer as the answer?
Anderson Imes
because the question was "why MembershipUser can't be serialized to the client". The right answer is the one i wrote below. Your answer was very helpful for me but still so i marked your answer as helpful, but it wasn't the answer. sorry, and I'm really thank you
Tamir
Your original "question" actually contains no questions (notice you have no question marks (?)... I took a stab at what you might be asking, which I understood to be "how to I find out what is wrong" since you didn't seem to have an error message. I'll let it go this time, but you should be careful with your questions on here... you might get some ill will from others who spend a bit of their time researching your issues for you.
Anderson Imes