Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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 WsDualHttpBinding不';不要给客户回电话,及时处理问题_Wcf_Credentials_Wsdualhttpbinding - Fatal编程技术网

Wcf WsDualHttpBinding不';不要给客户回电话,及时处理问题

Wcf WsDualHttpBinding不';不要给客户回电话,及时处理问题,wcf,credentials,wsdualhttpbinding,Wcf,Credentials,Wsdualhttpbinding,这个问题已经被问了一遍又一遍,但不管人们的项目有什么解决方案,对我来说都不起作用 我有一个WsDualHttpBinding从客户端调用服务。我的客户端配置如下: <bindings> <wsDualHttpBinding> <binding name="wsDualHttpBindingConfiguration" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout=

这个问题已经被问了一遍又一遍,但不管人们的项目有什么解决方案,对我来说都不起作用

我有一个WsDualHttpBinding从客户端调用服务。我的客户端配置如下:

 <bindings>
  <wsDualHttpBinding>
    <binding name="wsDualHttpBindingConfiguration" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:05:00" bypassProxyOnLocal="true" />
  </wsDualHttpBinding>
</bindings>

我的客户被进一步定义为:

<client>
        <endpoint address="http://{ipadress}:60379/ConfigurationCompleterService.svc"
            binding="wsDualHttpBinding" bindingConfiguration="wsDualHttpBindingConfiguration"
            contract="InfluxConfigurationCompleterService.IConfigurationCompleterService"
            name="WSDualHttpBinding_IConfigurationCompleterService">
            <identity>
                <userPrincipalName value="{domain-username}" />
            </identity>
        </endpoint>
      <!--wsDualHttpBindingConfiguration-->
        <endpoint address="http://{ipadress}:60379/ConfigurationImportService.svc"
            binding="wsDualHttpBinding" bindingConfiguration="wsDualHttpBindingConfiguration" 
            contract="ConfigurationImportServiceReference.IConfigurationImportService"
            name="WSDualHttpBinding_IConfigurationImportService">
            <identity>
                <userPrincipalName value="{domain-username}" />
            </identity>
        </endpoint>
    </client>

这在本地模式下工作,在同一台机器上。在服务器上部署服务并启动客户端时,超时1分钟后会收到以下错误消息:

未处理的异常:System.ServiceModel.CommunicationException:安全协商失败,因为远程方未及时发送回复。这可能是因为基础传输连接已中止

我知道问题要么是因为端口(但在这里我特别将其部署在与80不同的端口上)要么是因为安全问题

因此,我尝试将安全属性插入到绑定配置中:


还有一些我不记得了。 在VS2012上运行良好的情况下,我部署了我的服务后,即使在同一台机器上也无法访问它

我的服务托管良好,我可以通过web浏览器和远程机器访问它们

提前谢谢


PS:是否有任何方法可以以绝对不安全的方式配置WsDualHttpBinding,而根本不需要任何凭据?

我也有同样的问题,但这是因为我的客户端代码。例如:

WSDualHttpBinding binding = new WSDualHttpBinding();
binding.Security.Mode = WSDualHttpSecurityMode.None; <-- I forgot this line.
EndpointAddress endpoint = new EndpointAddress("http://localhost/CardService.svc");
DuplexChannelFactory<ICardService> channelFactory = new DuplexChannelFactory<ICardService>(this, binding, endpoint);
ICardService channel = channelFactory.CreateChannel();
string message = "Hello, service.";
Console.WriteLine("Successfully created the channel. Pinging it with message \"{0}\".", message);
channel.Ping(message);
Console.WriteLine("Successfully pinged the channel.");
WSDualHttpBinding=新的WSDualHttpBinding();
binding.Security.Mode=WSDualHttpSecurityMode.None;
WSDualHttpBinding binding = new WSDualHttpBinding();
binding.Security.Mode = WSDualHttpSecurityMode.None; <-- I forgot this line.
EndpointAddress endpoint = new EndpointAddress("http://localhost/CardService.svc");
DuplexChannelFactory<ICardService> channelFactory = new DuplexChannelFactory<ICardService>(this, binding, endpoint);
ICardService channel = channelFactory.CreateChannel();
string message = "Hello, service.";
Console.WriteLine("Successfully created the channel. Pinging it with message \"{0}\".", message);
channel.Ping(message);
Console.WriteLine("Successfully pinged the channel.");