我看過很多解決方案來解決我的問題,但我沒有找到對我有用的任何東西。用web服務發送一個大陣列
我的問題很簡單:我無法通過webservice發送長字節數組。我可以發送一個代表4千字節但沒有更大的圖像的數組。
這是客戶端配置
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ICespitiAVService" closeTimeout="02:00:00"
openTimeout="02:00:00" receiveTimeout="02:00:00" sendTimeout="02:00:00" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" >
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:51366/CespitiAVService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICespitiAVService"
contract="CespitiAVService.ICespitiAVService" name="BasicHttpBinding_ICespitiAVService"/>
</client>
</system.serviceModel>
</configuration>
這是服務器配置
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<client />
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<dataContractSerializer maxItemsInObjectGraph="655360"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true"/>
</system.serviceModel>
哪裏有人說把readerquotas也是在客戶端的配置已經閱讀解決方案,但XML贏得」不接受它,說它只接受安全節點。
有人說在客戶端配置中更改transfermode會解決問題,但我只能使用緩衝模式,它不接受其他任何東西。
我用過fiddler,它說程序超過了maxarraylength,你可以看到我在web.config中改變了這個值,但是我不能在客戶端配置中更改,因爲它表示綁定節點沒有readerquotas屬性。
的問題是在客戶端配置,因爲我不能添加readerquotas,我已經試圖再次創造配置文件,但沒有任何變化,我已經創建了一個新的虛擬項目,看看我是否可以將rederquotas添加到客戶端配置,但我再也不能這樣做 – zizzi 2012-03-14 08:24:24
是的,我遇到了同樣的情況。 .ClientConfig似乎與應用程序或web.config文件不同。任何方案? – 2012-10-22 08:09:40