我一直在玩一個pollingDuplex的例子,這讓我瘋狂。我正在使用customBinding集成readerQuotas元素,並且不斷收到錯誤消息:「合同需要雙工,但綁定的'BasicHttpBinding'不支持它或者沒有正確配置以支持它。」 BasicHttpBinding來自何時使用customBinding?我檢查了無數的例子,並且我的配置文件與他們的配置文件相匹配,但它不起作用。誰能幫我這個 ? 謝謝。WCF customBinding問題
<configuration>
<system.serviceModel>
<extensions>
<bindingElementExtensions>
<add name="pollingDuplex" type="System.ServiceModel.Configuration.PollingDuplexElement, System.ServiceModel.PollingDuplex"/>
</bindingElementExtensions>
</extensions>
<bindings>
<customBinding>
<binding name="DBNotification" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<httpsTransport maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"/>
<pollingDuplex duplexMode="MultipleMessagesPerPoll" maxPendingSessions="2147483647" maxPendingMessagesPerSession="2147483647"/>
<binaryMessageEncoding>
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binaryMessageEncoding>
</binding>
</customBinding>
</bindings>
<services>
<service name="AdminWebService" behaviorConfiguration="DBNotificationServiceBehavior">
<endpoint address="adminservice" binding="customBinding" bindingConfiguration="DBNotification" contract="AdminWebService.IAdminWebService" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DBNotificationServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentSessions="2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
我不知道是否屬於這種情況,但是您可以嘗試在您的自定義綁定中更改元素的順序,使得傳輸是最後一個(即' ',' '然後' ')? IIRC當你使用代碼來創建一個自定義綁定時,這個命令被強制執行。 –
carlosfigueira
不,同樣的事情。這就像它正在檢查另一個宇宙中的另一個web.config文件。 – algorunescu