バイト配列を C# サービスに送信 (または受信) しているときに、次の例外が発生します。
There was an error deserializing the object of type System.Byte[].
The maximum array length quota (16384) has been exceeded while reading XML data.
This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.
Line 6, position 34838.'.
Please see InnerException for more details
私が理解できることについては、XmlDictionaryreader は Web サービスによって自動的に作成されます。
では、「MaxArrayLength」プロパティを変更するにはどうすればよいですか?
これは実装コードです:
public string addFile(string sharePointServer, string documentLibrary,
byte[] content, string fileName)
{
try
{
SPWeb spWeb = new SPSite(sharePointServer).OpenWeb();
SPFolder spFolder = spWeb.GetFolder(documentLibrary);
SPFileCollection spFileCollection = spFolder.Files;
SPFile spFile = spFileCollection.Add(fileName, content, true);
return spFile.TimeCreated.ToLongDateString() + "::" + spFile.Title;
}
catch (Exception ex)
{
throw ex;
}
}
16kb 未満のファイルがアップロードされます。
ファイル> 16kbはそうではありません。
10MB を超えるファイルは問題なくダウンロードされます。
そのプロパティはどこで構成されていますか?