aggieben / xmlrpcnet

Automatically exported from code.google.com/p/xmlrpcnet
0 stars 0 forks source link

XmlRpcSerializer.DeserializeResponse() #90

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

 I'm calling Server.Login()
 DeserializeResponse() is called with a MemoryStream
 AllowInvalidHTTPContent is false
 when the using XmlTextReader statement ends it is disposed
 this has the side affect of calling stm.Close()
 this stream was created by XmlRpcClientProtocol.Invoke()
 and it expects it to remain usable
 Line "deserStream.Position = 0;" generates the exception
 System.ObjectDisposedException

What is the expected output? What do you see instead?

 no exception

What version of the product are you using? On what operating system?

 Version 2.5.0 Release
 Windows XP

Please use labels and text to provide additional information.

  I can prevent the exception by moving this block from inside the if(AllowInvalidHTTPContent) to just before it so that it always copies

     // Never dispose the original input stream
     Stream newStm = new MemoryStream();
     Util.CopyStream(stm, newStm);
     stm = newStm;
     stm.Position = 0;

  I am compiling C# with VS 8 and .NET 3.5

Callstack:

CookComputing.XmlRpcV2.dll!CookComputing.XmlRpc.XmlRpcSerializer.DeserializeResp
onse(System.IO.Stream stm = {System.IO.MemoryStream}, System.Type svcType = 
{Name = "LoginResult" FullName = "Bugzproxy.ProxyStructs.LoginResult"}) Line 
497 C#
    CookComputing.XmlRpcV2.dll!CookComputing.XmlRpc.XmlRpcClientProtocol.ReadResponse(CookComputing.XmlRpc.XmlRpcRequest req = {CookComputing.XmlRpc.XmlRpcRequest}, System.Net.WebResponse webResp = {System.Net.HttpWebResponse}, System.IO.Stream respStm = {System.IO.MemoryStream}, System.Type returnType = null) Line 492 + 0x10 bytes   C#
    CookComputing.XmlRpcV2.dll!CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(object clientObj = {XmlRpcProxy681b7f34-ca6f-4cb6-b9f6-f9d4745e6519}, System.Reflection.MethodInfo mi = {Bugzproxy.ProxyStructs.LoginResult Login(Bugzproxy.ProxyStructs.LoginParam)}, object[] parameters = {object[1]}) Line 207 + 0x13 bytes C#
    CookComputing.XmlRpcV2.dll!CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(System.Reflection.MethodInfo mi = {Bugzproxy.ProxyStructs.LoginResult Login(Bugzproxy.ProxyStructs.LoginParam)}, object[] Parameters = {object[1]}) Line 103 + 0x11 bytes   C#
    XmlRpcProxy681b7f34-ca6f-4cb6-b9f6-f9d4745e6519!XmlRpcProxy681b7f34-ca6f-4cb6-b9f6-f9d4745e6519.Login(Bugzproxy.ProxyStructs.LoginParam param = {Bugzproxy.ProxyStructs.LoginParam}) + 0xf6 bytes   
    bugzproxy.dll!Bugzproxy.Server.Login(string username = "name", string password = "pwd", bool remember = false) Line 483 + 0x1f bytes    C#

Original issue reported on code.google.com by paul.c.i...@gmail.com on 14 Apr 2011 at 5:09