2011-11-27 92 views
1

這個問題與我以前的問題有關,我試圖通過Web服務將varbinary保存到我的數據庫時出錯。binaryMessageEncoding不能包含子元素

我增加了maxArrayLength等。通過對發送到其工作原理是這樣(在web.config)服務器:

<binding name="OndernemersAward.Web.Service.EditAfbeeldingService.customBinding0"> 
    <binaryMessageEncoding> 
     <readerQuotas maxDepth="32" 
      maxStringContentLength="2147483647" 
      maxArrayLength="2147483647" 
      maxBytesPerRead="2147483647" 
      maxNameTableCharCount="2147483647" /> 

    </binaryMessageEncoding>     
    <httpTransport /> 
    </binding> 

但是,當我嘗試做這在我ServiceReferences.clientconfig

<binding name="CustomBinding_EditAfbeeldingService"> 
     <binaryMessageEncoding> 
     <readerQuotas maxArrayLength="2147483647" maxNameTableCharCount="2147483647" 
      maxStringContentLength="2147483647" maxDepth="2147483647" 
      maxBytesPerRead="2147483647" /> 
     </binaryMessageEncoding> 
     <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"/> 
    </binding> 

我收到以下錯誤:

The element 'binaryMessageEncoding' cannot contain child element 'readerQuotas' because the parent element's content model is empty.

I我只是試着嘗試解決我在之前的問題中遇到的錯誤,因爲我越來越絕望。 :P

我希望有人能幫助我,謝謝

回答

1

有在Silverlight沒有讀者配額(換句話說,他們都已經max'd出來),所以你的配置相當於一個如下:

<binding name="CustomBinding_EditAfbeeldingService"> 
    <binaryMessageEncoding/> 
    <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"/> 
</binding> 
+0

謝謝你,所以不能在錯誤我得到我的[其它問題](http://stackoverflow.com/questions/8280423/saving-image-to問題-database-as-varbinary-part-3/8280538#8280538)那麼? – Schoof

+0

正確,這不是問題。我也會在其他問題上發表評論。 – carlosfigueira

相關問題