我嘗試發送/接收大量請求/響應時,Web服務(asmx)出現問題...我不斷收到錯誤「的基礎連接已關閉:意外出錯一個接收」Web服務(asmx)錯誤 - 底層連接已關閉:接收時發生意外錯誤
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);
我還設置在webconfig <httpRuntime maxRequestLength="200000" executionTimeout="360000" />
,我仍然得到一個錯誤。
任何想法?
我檢查與提琴手,我總是得到「504網關超時」... – DiaMonD