2012-11-10 23 views
0

我遇到了最大的nametable char count配額問題,我在這裏跟了幾個答案,它解決了一段時間的問題,但現在我遇到了同樣的問題。超過了最大的可改名錶字符數

我的服務器端配置如下:

<system.serviceModel> 
     <bindings> 
     <netTcpBinding> 
      <binding name="GenericBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" 
        maxReceivedMessageSize="2147483647"> 

      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" 
          maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      <security mode="None" /> 
      </binding> 
     </netTcpBinding> 
     </bindings> 
    <behaviors> 
      <serviceBehaviors> 
        <behavior> 
          <serviceMetadata httpGetEnabled="false" /> 
          <serviceDebug includeExceptionDetailInFaults="true" /> 
          <dataContractSerializer maxItemsInObjectGraph="1000000" /> 
        </behavior> 
      </serviceBehaviors> 
    </behaviors> 
    <services> 
      <service name="REMWCF.RemWCFSvc"> 
       <endpoint address="" binding="netTcpBinding" contract="REMWCF.IRemWCFSvc" bindingConfiguration="GenericBinding" /> 
       <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" /> 
       <host> 
       <baseAddresses> 
        <add baseAddress="net.tcp://localhost:9081/RemWCFSvc" /> 
       </baseAddresses> 
       </host> 
      </service> 
    </services> 
    </system.serviceModel> 

我也有相同的TCP上的devenv的配置結合。

我是否達到了支持合同的限制?有沒有辦法關閉配額?

編輯

錯誤消息:

Error: Cannot obtain Metadata from net.tcp://localhost:9081/RemWCFSvc/mex If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: net.tcp://localhost:9081/RemWCFSvc/mex Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:9081/RemWCFSvc/mex'. There is an error in the XML document. The maximum nametable character count quota (16384) has been exceeded while reading XML data. The nametable is a data structure used to store strings encountered during XML processing - long XML documents with non-repeating element names, attribute names and attribute values may trigger this quota. This quota may be increased by changing the MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object used when creating the XML reader.

嘗試運行WCF(在Windows服務應用程序託管)時,我得到這個錯誤。

+0

據我所知,消息的大小沒有限制。正確配置有時非常棘手。你會得到什麼錯誤信息? –

+0

我更新了錯誤的問題。 – doc

+0

我編輯了你的標題。請參閱:「[應該在其標題中包含」標籤「](http://meta.stackexchange.com/questions/19190/)」,其中的共識是「不,他們不應該」。 –

回答

0

這裏是正確的網頁配置。您需要將metadataenabled設置爲true,並且您還沒有定義行爲名稱。試試這個配置。

<system.serviceModel> 
     <bindings> 
     <netTcpBinding> 
      <binding name="GenericBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" 
        maxReceivedMessageSize="2147483647"> 

      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" 
          maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      <security mode="None" /> 
      </binding> 
     </netTcpBinding> 
     </bindings> 
    <behaviors> 
    <serviceBehaviors> 
     <behavior name="SilverlightWCFLargeDataApplication"> 
     <serviceMetadata httpGetEnabled="true"/> 
     <serviceDebug includeExceptionDetailInFaults="false"/> 
     <dataContractSerializer maxItemsInObjectGraph="2147483647"/> 
     </behavior> 

    </serviceBehaviors> 
    <endpointBehaviors> 
     <behavior name="SilverlightWCFLargeDataApplication"> 
     <dataContractSerializer maxItemsInObjectGraph="2147483647"/> 
     </behavior> 
    </endpointBehaviors> 
    </behaviors> 
    <services> 
      <service name="REMWCF.RemWCFSvc" behaviorConfiguration="SilverlightWCFLargeDataApplication"> 
       <endpoint address="" behaviorConfiguration="SilverlightWCFLargeDataApplication" binding="netTcpBinding" contract="REMWCF.IRemWCFSvc" bindingConfiguration="GenericBinding" /> 
       <host> 
       <baseAddresses> 
        <add baseAddress="net.tcp://localhost:9081/RemWCFSvc" /> 
       </baseAddresses> 
       </host> 
      </service> 
    </services> 
    </system.serviceModel> 
相關問題