C# Web服务(asmx)错误-基础连接已关闭:接收时发生意外错误

C# Web服务(asmx)错误-基础连接已关闭:接收时发生意外错误,c#,web-services,C#,Web Services,当我尝试发送/接收大型请求/响应时,Web服务(asmx)出现问题。。。我不断收到错误“基础连接已关闭:接收时发生意外错误” 我还在webconfig中设置了,但仍然收到一个错误 有什么想法吗?请更改u r maxRequestLength=Int32.MaxValue() 哪一个会在某处 =2147481263当我在过去看到此错误时,问题是响应XML无效,并且由于处理无效XML期间发生异常而关闭连接。我将尝试保存原始XML请求数据,然后根据web服务的模式验证该XML数据。您可能会发现响应XM

当我尝试发送/接收大型请求/响应时,Web服务(asmx)出现问题。。。我不断收到错误“基础连接已关闭:接收时发生意外错误”

我还在webconfig中设置了
,但仍然收到一个错误


有什么想法吗?

请更改u r maxRequestLength=Int32.MaxValue()

哪一个会在某处
=2147481263

当我在过去看到此错误时,问题是响应XML无效,并且由于处理无效XML期间发生异常而关闭连接。我将尝试保存原始XML请求数据,然后根据web服务的模式验证该XML数据。您可能会发现响应XML中存在一些无效内容,导致连接被强制关闭。

我与fiddler进行了检查,并始终得到“504网关超时”…我进行了检查,XML响应有效。我认为托管web服务的服务器有问题。我与其他使用此web服务的人进行了检查,他们也有相同的问题。。。
HttpWebRequest request = HttpWebRequest.Create("https://test.smth.cin:443/ws/1.0") as HttpWebRequest;
request.KeepAlive = true;
request.Method = "POST";
request.ContentType = "text/xml; charset=utf-8";
request.ClientCertificates.Add(Cert);
request.Headers.Add("SOAPAction", @"https://test.smth.cin:443/ws/1.0" + p_SOAPAction);
request.Timeout = 2200000;
StreamWriter requestWriter = new StreamWriter(request.GetRequestStream(),System.Text.Encoding.UTF8);
requestWriter.Write(str_SOAP);
requestWriter.Flush();
requestWriter.Close(); 



   HttpWebResponse response = request.GetResponse() as HttpWebResponse;
    Stream responsedata = response.GetResponseStream();
    StreamReader responsereader = new StreamReader(responsedata);

    WS_Response ws_r = new WS_Response();
    XmlDocument WS_XML_Response = new XmlDocument();

    byte[] encodedString = Encoding.UTF8.GetBytes(str_SOAP);

    // Put the byte array into a stream and rewind it to the beginning
    MemoryStream ms = new MemoryStream(encodedString);
    ms.Flush();
    ms.Position = 0;
    WS_XML_Response.Load(ms);