WCF双工不在Azure下工作。在IIS下一切正常工作。我知道双工绑定是有问题的,因为服务器回调,但是.我已经关闭了防火墙。TCPView (Sysinternals)显示客户端发送/接收10到12个数据包,然后它就死了.什么都没发生。我把所有的超时时间都设置为10分钟。
下面请看我的配置文件。
服务器配置:
<system.serviceModel>
<services>
<service behaviorConfiguration="MexBehaviour" name="MySrvc">
<endpoint address="" binding="wsDualHttpBinding" bindingConfiguration="wsDualHttpBinding"
name="wsDualEndpoint" bindingName="wsDualHttpBinding" contract="IMySrvc" />
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="mexHttpBinding"
name="MexEndpoint" bindingName="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://srvc.azurewebsites.net/MySrvc.svc" />
</baseAddresses>
<timeouts openTimeout="00:10:00" />
</host>
</service>
</services>
<bindings>
<wsDualHttpBinding>
<binding name="wsDualHttpBinding" openTimeout="00:10:00" sendTimeout="00:10:00"
clientBaseAddress="http://xxx.xxx.xxx.xxx:xxx">
<security mode="None">
<message clientCredentialType="None" negotiateServiceCredential="false" />
</security>
</binding>
</wsDualHttpBinding>
<mexHttpBinding>
<binding name="mexHttpBinding" />
</mexHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MexBehaviour">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
客户端配置:
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="wsDualEndpoint">
<security mode="None" />
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://srvc.azurewebsites.net/MySrvc.svc"
binding="wsDualHttpBinding" bindingConfiguration="wsDualEndpoint"
contract="SrvcRef.IMySrvc" name="wsDualEndpoint" />
</client>
</system.serviceModel>发布于 2014-12-30 01:11:58
我知道这个wsDualHttpBinding没有通过“嗅觉测试”.来自Juval Lowy的书“编程WCF服务:掌握WCF和Azure AppFabric服务总线”:
WSDualHttpBinding大多是不可用的,因为实际上不可能穿越将服务与客户端分离开来的各种通信障碍,并且需要找到特定的web服务器机器,这使得这种做法不切实际。
我用netTcpBinding来解决我的问题.您只需要让IIS使用TCP协议即可。有很多文章解释如何做这件事。这里有一个:http://msdn.microsoft.com/en-us/library/ms731053.aspx
干杯。
https://stackoverflow.com/questions/27644026
复制相似问题