0
我正在從Web應用程序調用WCF服務。它適用於本地web服務。當服務部署到開發服務器時,它給了我上面的錯誤。 Webservice返回xml格式的自定義對象列表。WCF底層連接已關閉:接收方發生意外錯誤
[OperationContract()]
[WebInvoke(Method = "POST", UriTemplate = "/track/get", ResponseFormat = WebMessageFormat.Xml)]
List<tokenCount> GetTracking(System.IO.Stream data);
如果我只從webservice返回一個字符串,它工作正常。 webservice中的其他操作正常工作。
oRequest.ContentLength = aBytes.Length;
oRequest.KeepAlive = false;
oRequest.ProtocolVersion = HttpVersion.Version10;
oRequest.ConnectionGroupName = Guid.NewGuid().ToString();
oRequest.Timeout = 60000;
using (Stream oRequestStream = oRequest.GetRequestStream())
{
oRequestStream.Write(aBytes, 0, aBytes.Length);
using (HttpWebResponse oResponse = (HttpWebResponse)oRequest.GetResponse())
{
using (StreamReader oReader = new StreamReader(oResponse.GetResponseStream(), Encoding.UTF8))
{
Response.ContentType = "application/xml";
//resDoc = CreateMetaFile(oReader.ReadToEnd());
string r = oReader.ReadToEnd();
}
}
}
當前我只保留一條記錄,該條記錄用於統計條件並從web服務返回。 – devel 2010-11-08 06:32:57
本地web應用程序,web服務遠程給出了上述錯誤。本地Web應用程序和本地web服務可以返回10個對象。我需要在哪裏設置maxRecivedMessageSize屬性? – devel 2010-11-08 06:35:23
@devel - 'maxReceivedMessageSize'在客戶端配置文件的部分中的客戶端''的服務配置中設置 –
InSane
2010-11-08 06:52:07