我已經在服務器配置文件中定義了maxBufferSize = 2147483647,maxBufferPoolSize = 2147483647,maxReceivedMessageSize = 2147483647,但是當我生成客戶端配置文件時,所有這些參數的值都默認在那裏我必須手動編輯它們。這是因爲我在MAXBUFFERSIZE,maxBufferPoolSize,maxReceivedMessageSize和maxItemsInObjectGraph使用最大值如何生成客戶端配置文件wcf客戶端配置沒有從服務器獲取值app.config
svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config net.tcp:/
/localhost:4365/MyService
而且,是會打的表現?
--Server配置values--
<bindings>
<netTcpBinding>
<binding name="MySvc_InsecureTcp" closeTimeout="00:01:10" openTimeout="00:01:10" receiveTimeout="24.20:31:23.6470000"
listenBacklog="1000" maxConnections="1000" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None">
<transport protectionLevel="None" />
</security>
</binding>
<binding name="MySvc_mexBinding" closeTimeout="00:01:10" openTimeout="00:01:10" receiveTimeout="24.20:31:23.6470000"
listenBacklog="1000" maxConnections="1000" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None">
<transport protectionLevel="None" />
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MyService">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceThrottling maxConcurrentCalls="30" maxConcurrentInstances="2147483647" maxConcurrentSessions="30" />
<serviceMetadata />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="MyNameSpace.MyService" behaviorConfiguration="MyService">
<endpoint address="" binding="netTcpBinding" contract="MyNameSpace.IMyService"
bindingConfiguration="MySvc_InsecureTcp" name="netTcpMySvc" >
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="netTcpBinding" contract="IMetadataExchange"
bindingConfiguration="MySvc_mexBinding" name="mexMySvc" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:4365/MyService"/>
</baseAddresses>
</host>
</service>
</services>
--AFTER做一些更testing--
maxItemsInObjectGraph犯規獲得包括在客戶端配置文件。如果客戶端發送大對象,則應手動更改maxItemsInObjectGraph。
<behaviors>
<endpointBehaviors>
<behavior name="FASTServiceBehaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
因此,如果我期待客戶端發送大對象,我不知道在服務器端更改這些值,但不改變客戶端? – Asdfg 2011-06-08 13:58:47
如果您不想將大對象發送回客戶端,則不需要更改它。 – 2011-06-08 14:00:04
這是一種單向操作。客戶端不會收回任何東西。 – Asdfg 2011-06-08 14:00:57