より大きなサイズのファイルをアップロードしているときに問題に直面しています。このように形成されたリクエスト/レスポンスにWCFサービスのbasicHttpBindingを使用しています。
int MAXSIZE = Int32.MaxValue;
BasicHttpBinding binding = new BasicHttpBinding()
{
CloseTimeout = new TimeSpan(0, 1, 0),
OpenTimeout = new TimeSpan(0, 1, 0),
ReceiveTimeout = new TimeSpan(0, 10, 0),
SendTimeout = new TimeSpan(0, 10, 0),
AllowCookies = false,
BypassProxyOnLocal = false,
HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
MaxBufferSize = MAXSIZE,
MaxBufferPoolSize = MAXSIZE,
MaxReceivedMessageSize = MAXSIZE,
MessageEncoding = WSMessageEncoding.Text,
TextEncoding = System.Text.Encoding.UTF8,
TransferMode = System.ServiceModel.TransferMode.Buffered,
UseDefaultWebProxy = true,
};
binding.ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas()
{
MaxDepth = 32,
MaxStringContentLength = MAXSIZE,
MaxArrayLength = MAXSIZE,
MaxBytesPerRead = MAXSIZE,
MaxNameTableCharCount =16384,
};
ネット上の回答によると、それは機能するはずですが、例外がスローされています。リモート サーバーが予期しない応答を返しました: (400) 不正な要求。
誰かが前にそのような状況に遭遇しましたか?