C# 复制问题:客户端身份验证方案禁止http请求';匿名';

C# 复制问题:客户端身份验证方案禁止http请求';匿名';,c#,wcf,http,wcf-binding,wcf-security,C#,Wcf,Http,Wcf Binding,Wcf Security,我想重新生成wcf问题:客户端身份验证方案“匿名”禁止http请求。 我们在产品中使用wcf服务,我们已将wcf服务作为Windows服务(自助主机服务)托管,该wcf服务正在被一个小型的Windows客户端应用程序使用 在我们的环境中,一切正常。但是,我们的一位客户报告说,当他们从远程客户端计算机连接客户端应用程序时,收到错误“客户端身份验证方案“匿名”禁止http请求” 在这里,我的问题是,谁能帮助我在我们的环境中重新生成这个问题,以便我们能够提供完美的解决方案 ServiceApp.con

我想重新生成wcf问题:客户端身份验证方案“匿名”禁止http请求。

我们在产品中使用wcf服务,我们已将wcf服务作为Windows服务(自助主机服务)托管,该wcf服务正在被一个小型的Windows客户端应用程序使用

在我们的环境中,一切正常。但是,我们的一位客户报告说,当他们从远程客户端计算机连接客户端应用程序时,收到错误“客户端身份验证方案“匿名”禁止http请求”

在这里,我的问题是,谁能帮助我在我们的环境中重新生成这个问题,以便我们能够提供完美的解决方案

ServiceApp.config

<bindings>
      <wsHttpBinding>
        <binding name="MyBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="100" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
          <reliableSession inactivityTimeout="24.00:00:00" />
          <security mode="None">
            <message clientCredentialType="None" />
          </security>

        </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="MyBehaviour" name="WcfServer.CalculatorService">
        <endpoint address="http://localhost:7000/Test" behaviorConfiguration="MyEndPointBehavior"
          binding="wsHttpBinding"  bindingConfiguration="MyBinding"
          name="EndPt_Service" contract="WcfServer.ICalculator"/>
      </service>
    </services>
<bindings>
      <wsHttpBinding>
        <binding name="CalBinding" maxBufferPoolSize="2147483647"  maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="100" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
          <reliableSession inactivityTimeout="24.00:00:00" />
          <security mode="None">
            <message clientCredentialType="None" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://RemoteServerName:7000/Test" behaviorConfiguration="CalEndPointBehavior"
        binding="wsHttpBinding" contract="WcfServer.ICalculator"
         name="EndPt_Calc" bindingConfiguration="CalBinding"/>
    </client>

clientapp.config

<bindings>
      <wsHttpBinding>
        <binding name="MyBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="100" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
          <reliableSession inactivityTimeout="24.00:00:00" />
          <security mode="None">
            <message clientCredentialType="None" />
          </security>

        </binding>
      </wsHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="MyBehaviour" name="WcfServer.CalculatorService">
        <endpoint address="http://localhost:7000/Test" behaviorConfiguration="MyEndPointBehavior"
          binding="wsHttpBinding"  bindingConfiguration="MyBinding"
          name="EndPt_Service" contract="WcfServer.ICalculator"/>
      </service>
    </services>
<bindings>
      <wsHttpBinding>
        <binding name="CalBinding" maxBufferPoolSize="2147483647"  maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="100" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
          <reliableSession inactivityTimeout="24.00:00:00" />
          <security mode="None">
            <message clientCredentialType="None" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://RemoteServerName:7000/Test" behaviorConfiguration="CalEndPointBehavior"
        binding="wsHttpBinding" contract="WcfServer.ICalculator"
         name="EndPt_Calc" bindingConfiguration="CalBinding"/>
    </client>

我在msdn论坛上找到了这个,希望它能帮助您:

因为您已经为WsHttpBinding指定了安全模式=无,所以当它向WCF服务发出请求时,该服务将尝试使用合法凭据对客户端进行身份验证,但对于不同的域,这将不起作用,所以请尝试使用X509认证

因此,尝试在两个不同的域之间建立连接