我有WCF服务(由IIS托管),它在没有域控制器的Intranet环境中与wsDualHttpBinding一起使用。
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="BasicDuplexBinding" closeTimeout="00:03:00" openTimeout="00:03:00"
receiveTimeout="00:03:00" sendTimeout="00:03:00" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" messageEncoding="Mtom"
textEncoding="utf-8" useDefaultWebProxy="true" >
<security mode="None">
<message clientCredentialType="None"/>
</security>
<readerQuotas ... />
</binding>
</wsDualHttpBinding>
</bindings>
<services>
<service name="..." behaviorConfiguration="myBehavior">
<endpoint address=""
binding="wsDualHttpBinding" bindingConfiguration="BasicDuplexBinding"
name="Basic" contract="UniDubna.InfSys.Document.WcfDocManager.Contracts.Reporting.IReportService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="myBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceThrottling maxConcurrentCalls="10" maxConcurrentInstances="500" maxConcurrentSessions="500"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
有些客户端工作站与WCF服务完美配合,有些客户端工作站无法建立连接(超时)。同时,我可以在每个客户端的浏览器中打开http://my-server/my-service.svc
文件,并可以获得"wsdl"描述。我想有些客户端由于防火墙的原因无法建立双向通信。我该怎么查?如何控制客户端的回调端口,最好是在配置文件中?
客户端配置看起来像:
...
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="BasicDuplexBinding" closeTimeout="00:02:00" openTimeout="00:02:00"
receiveTimeout="00:02:00" sendTimeout="00:02:00" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" messageEncoding="Mtom"
textEncoding="utf-8" useDefaultWebProxy="true" >
<security mode="None">
<message clientCredentialType="None"/>
</security>
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</wsDualHttpBinding>
...
<client>
<endpoint name="myService" bindingConfiguration="BasicDuplexBinding" address="http://my-server/my-service.svc" binding="wsDualHttpBinding" contract="..."/>
</client>
您还记得客户端wsdualhttpbinding中绑定的clientBaseAddress="http://IP:PORT/NameService"
吗?