在用WebService傳送圖片數據時,客戶端報錯:
格式化程序嘗試對消息反序列化時引發異常: 嘗試對參數 進行反序列化時出錯: GoodsImageResponse。InnerException 消息是“反序列化對象 屬於類型 WhDClient.WHDRef.GoodsImageResponseBody 時出現錯誤。讀取 XML 數據時,超出最大數組長度配額(16384)。通過更改在創建 XML 讀取器時所使用的 XmlDictionaryReaderQuotas 對象的 MaxArrayLength 屬性,可增加此配額。 第 1 行,位置爲 160350。”。有關詳細信息,請參閱 InnerException。
然後在binding下添加<readerQuotas maxArrayLength="2147483647"/>屬性即可。
<binding name="WhDecisionSoap" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxArrayLength="2147483647"/>
</binding>