Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WCF-双工连接(托管在IIS中)_Wcf_Iis_Duplex - Fatal编程技术网

WCF-双工连接(托管在IIS中)

WCF-双工连接(托管在IIS中),wcf,iis,duplex,Wcf,Iis,Duplex,我有一个全双工,我在本地机器上成功运行。 我将其托管在我的服务器(IIS-server 2008 R2-STANDARD)中,并尝试连接,如下所示: this.myCallbackProxy = new MyCallbackProxy(); InstanceContext cntx = new InstanceContext(myCallbackProxy); this.Proxy = new MyServiceClientProxy(cntx, "WSDualHttpBinding_I

我有一个全双工,我在本地机器上成功运行。 我将其托管在我的服务器(IIS-server 2008 R2-STANDARD)中,并尝试连接,如下所示:

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";
现在,当我尝试调用API时,我一直坚持到超时

我尝试将IIS中的WCF配置为以特定用户身份连接,但当我尝试从客户端调用API时,出现以下异常:

"The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response"
我必须提到的是,我有另一个WCF托管在相同的IIS中,具有相同的用户(服务器用户名),并且它工作得非常完美。(我为双工WCF创建另一个(类似)应用程序轮询)

我的配置文件:

<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">
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </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>


如果您使用浏览器访问服务,是否会看到信息页面?如果在服务尝试启动时出错,则可能会出现此错误。当您浏览到它时,您会看到错误消息。是的,我可以获得信息页面。当我没有在IIS中配置为连接为xxx时,我会收到以下错误:“打开操作未在分配的超时00:00:59.9939997内完成。分配给此操作的时间可能是更长超时的一部分。”,我添加this.Proxy.ClientCredentials.Windows.ClientCredential.UserName=this.Proxy.ClientCredentials.Windows.ClientCredential.Password,这与我对其他WCF所做的完全相同(它们工作完美,配置相同)