无法从客户端访问WCF双工

无法从客户端访问WCF双工,wcf,iis-7,duplex,Wcf,Iis 7,Duplex,我被卡住了,不知道为什么我不能连接到我的WCF 详情: 我有一个双工WCF,它成功地在我的本地窗口中运行和工作。我将其托管在服务器(IIS-server 2008 R2-STANDARD)中,并尝试连接,但出现错误似乎是安全问题,我可以从web浏览器访问它并获取所有xml 在我的客户机中,我尝试按以下方式访问它: this.myCallbackProxy = new MyCallbackProxy(); InstanceContext cntx = new InstanceContext(m

我被卡住了,不知道为什么我不能连接到我的WCF

详情:

我有一个双工WCF,它成功地在我的本地窗口中运行和工作。我将其托管在服务器(IIS-server 2008 R2-STANDARD)中,并尝试连接,但出现错误似乎是安全问题,我可以从web浏览器访问它并获取所有xml

在我的客户机中,我尝试按以下方式访问它:

this.myCallbackProxy = new MyCallbackProxy();
  InstanceContext cntx = new InstanceContext(myCallbackProxy);
  this.Proxy = new MyServiceClientProxy(cntx, "WSDualHttpBinding_I_BridgeWCFService");
//我还尝试添加以下内容,但不起作用

this.Proxy.ClientCredentials.Windows.ClientCredential.UserName = "YY";
  this.Proxy.ClientCredentials.Windows.ClientCredential.Password = "PP";
上述操作已通过,没有错误或异常。 然后:

例外情况:

打开操作未在分配的超时内完成 00:00:59.0849477. 分配给此操作的时间可能是一段时间 较长超时的一部分

我必须提到的是,我有另一个WCF托管在相同的IIS(不是双工)中,具有相同的用户(服务器用户名),并且它工作得非常完美。(我对两者使用相同的应用程序轮询,我还尝试创建新的应用程序池

如果我通过链接“http://xx.xx.xx.xx/_Bridge/_BridgeWcfService.svc“在我想要运行应用程序的机器的web浏览器中,我得到了xml…正如预期的那样

服务和客户端都具有安全性=“无”

你知道我为什么无法连接吗:(

下面是App.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
  <wsDualHttpBinding>
    <binding name="WSDualHttpBinding_I_BridgeWCFService" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
      maxBufferPoolSize="2147483646" maxReceivedMessageSize="2147483646"
      messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483646"
        maxArrayLength="2147483646" maxBytesPerRead="2147483646" maxNameTableCharCount="2147483646" />
      <reliableSession ordered="true" inactivityTimeout="00:10:00"/>
      <security mode="None"/>
    </binding>
  </wsDualHttpBinding>
</bindings>
<client>
  <endpoint address="http://xx.xx.xx.xx/_Bridge/_BridgeWcfService.svc" 
            binding="wsDualHttpBinding" 
            bindingConfiguration="WSDualHttpBinding_I_BridgeWCFService" 
            contract="_BridgeWcfServiceReference.I_BridgeWCFService" 
            name="WSDualHttpBinding_I_BridgeWCFService">
    <identity>
      <dns value="localhost"/>
    </identity>
  </endpoint>
</client>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
  </startup>
</configuration>

这听起来像是一个防火墙问题-wsDualHttpBinding在试图打开从服务器到客户端的连接时,一旦涉及到防火墙,就很容易崩溃。我建议使用NetTcpBinding进行双工通信


我在博客中提到了这一点

这听起来像是一个防火墙问题-wsDualHttpBinding在试图打开从服务器到客户端的连接时,一旦涉及到防火墙,它就很容易崩溃。我建议使用NetTcpBinding进行双工通信


我在博客中提到了这一点

您的服务代理上的其他操作是什么?您可以调用这些操作而不是Open()?否!!!,如果我删除此处的Open,任何操作都会引发相同的异常:“打开操作未在分配的超时00:00:59.9939996内完成。分配给此操作的时间可能是更长超时的一部分。服务代理上的其他操作是什么?您可以调用这些操作而不是open()?否!!!,如果我删除此处的打开,任何操作都会引发相同的异常:”打开操作未在分配的超时00:00:59.9939996内完成。分配给此操作的时间可能是更长超时的一部分。“您好,我发现问题出在测试应用程序端的防火墙上,它在回拨的双工连接过程中阻止了来自服务器的收入通道。多亏了Richard Blewett,我一直在尝试使用服务器,而我的本地PC出现了问题(我只是关闭了PC中的防火墙)这是可行的。嗨,我发现问题出在测试应用程序端的防火墙,它在回拨的双工连接过程中阻断了来自服务器的收入通道。多亏了Richard Blewett,我一直在尝试使用服务器,而我的本地PC出现了问题(我只是关闭了PC中的防火墙),并且它工作正常。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
  <wsDualHttpBinding>
    <binding name="WSDualHttpBinding_I_BridgeWCFService" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
      maxBufferPoolSize="2147483646" maxReceivedMessageSize="2147483646"
      messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="2147483646"
        maxArrayLength="2147483646" maxBytesPerRead="2147483646" maxNameTableCharCount="2147483646" />
      <reliableSession ordered="true" inactivityTimeout="00:10:00"/>
      <security mode="None"/>
    </binding>
  </wsDualHttpBinding>
</bindings>
<client>
  <endpoint address="http://xx.xx.xx.xx/_Bridge/_BridgeWcfService.svc" 
            binding="wsDualHttpBinding" 
            bindingConfiguration="WSDualHttpBinding_I_BridgeWCFService" 
            contract="_BridgeWcfServiceReference.I_BridgeWCFService" 
            name="WSDualHttpBinding_I_BridgeWCFService">
    <identity>
      <dns value="localhost"/>
    </identity>
  </endpoint>
</client>
  </system.serviceModel>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
  </startup>
</configuration>