WCF绑定设置 - maxRetryCount =“Integer”

时间:2015-06-18 02:02:32

标签: vb.net wcf

我正在尝试设置绑定设置maxRetryCount =“Integer”,但它指出“不允许使用maxRetryCount属性”。

我看到它在许多例子中被引用/使用。

我做错了什么?

想要设置此属性(设置)以查看它是否会停止我收到的错误:已超出最大重试次数而远程端点没有响应。可靠的会议出了问题。这通常表明远程端点不再可用。

 <?xml version="1.0"?>
 <configuration>  
   <appSettings>
     <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
   </appSettings>
   <system.web>
     <compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
     <httpRuntime targetFramework="4.5"/>
     <customErrors mode="Off"/>
   </system.web>  
   <system.serviceModel>    
     <services>
       <service name="dedicated_servers.dedicated_servers.DedicatedServerApi">
         <endpoint address="User" binding="wsHttpBinding" contract="dedicated_servers.dedicated_servers.IDedicatedServerApiUser"      bindingConfiguration="NoSecurityConfig">
         </endpoint>
         <endpoint address="Server" binding="wsHttpBinding" contract="dedicated_servers.dedicated_servers.IDedicatedServerApiServer"      bindingConfiguration="NoSecurityConfig">
         </endpoint>
         <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
       </service>
     </services>
     <bindings>
       <wsHttpBinding>
         <binding name="NoSecurityConfig" openTimeout="00:05:00" closeTimeout="00:05:00" sendTimeout="00:05:00"
          receiveTimeout="00:05:00">
           <security mode="None">
             <transport clientCredentialType="None" />
             <message establishSecurityContext="false" />
           </security>
           <reliableSession enabled="true" inactivityTimeout="00:10:00" maxRetryCount="8" />
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
       <serviceBehaviors>
         <behavior>
            <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
            <serviceDebug includeExceptionDetailInFaults="true"/>
         </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>    
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
     <modules runAllManagedModulesForAllRequests="true"/>
     <directoryBrowse enabled="true"/>
  </system.webServer>
 </configuration>

1 个答案:

答案 0 :(得分:0)

answer。换句话说,你不能在maxRetryCount上设置wsHttpBinding,但你可以做一些自定义绑定技巧来使它工作。