Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/267.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.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
C# Asp.net WCF和集成的Windows身份验证和IIS 6.0_C#_Asp.net_.net_Wcf - Fatal编程技术网

C# Asp.net WCF和集成的Windows身份验证和IIS 6.0

C# Asp.net WCF和集成的Windows身份验证和IIS 6.0,c#,asp.net,.net,wcf,C#,Asp.net,.net,Wcf,我一直在努力解决这个问题,读了很多问题,文章,但无法解决它。我来了 Webservice位于网站中,我从控制台应用程序[测试]访问它。这是我的Web.Config代码 <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="Services.CilsDataReceiveBehavior"> <servi

我一直在努力解决这个问题,读了很多问题,文章,但无法解决它。我来了

Webservice位于网站中,我从控制台应用程序[测试]访问它。这是我的Web.Config代码

 <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Services.CilsDataReceiveBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="WindowsAuth">
          <security mode="TransportCredentialOnly" >
            <transport clientCredentialType="Windows"/>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="Services.CilsDataReceiveBehavior" name="Services.CilsDataReceive">
        <endpoint address="" binding="basicHttpBinding" name="BasicHttpEndpoint" bindingConfiguration="WindowsAuth" contract="Services.ICilsDataReceive" />
        <endpoint address="mex" binding="webHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
      </system.serviceModel>
错误消息是 HTTP请求未经客户端身份验证方案“匿名”授权。从服务器收到的身份验证标头为“协商,NTLM”

如果将我的控制台应用程序app.config更改为

<security mode="TransportCredentialOnly">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>

我得到下面的错误 "'http://wgb01wa7002.worldwide.co.uk:44001/Services/CilsDataReceive.svc“无法激活。有关详细信息,请参阅服务器的诊断跟踪日志。”

我尝试了很多东西尝试WsHttpBinding,但我认为它使用Https而不是http

你能提出一些建议吗

编辑:如果我从浏览器访问它,我会得到“此服务的安全设置需要‘匿名’身份验证,但未为承载此服务的IIS应用程序启用。”

编辑2:我尝试使用netTCPBinding,错误更改为“提供的URI方案“http”无效;应为“https”。似乎我不应该使用它。 参数名称:via“


编辑3:我尝试使用wsHttpBinding,但仍然出现错误。这就像永无止境的错误。

首先,您的桌面环境是否设置为测试ssl?如果没有,请添加它


其次,您可能缺少的WsHttpsBinding

WsHttpBinding不是SSL特有的。它可以配置为打开或关闭SSL。这可以通过安全模式(传输=>SSL)进行配置。好的,但是我的问题的解决方案是什么?我应该使用netTCPBinding吗?试试,报告你的发现。我不想使用SSL。我想使用基本的Http绑定
icDateList.titlesField = titles.ToArray();
            var cilsDataReceiveClient = new CilsDataReceiveClient();
            try
            {
                cilsDataReceiveClient.RecieveICDateList(icDateList);
                Console.WriteLine(" O_O   Service saved the data   O_O");
            }
            catch (Exception exception)
            {
                cilsDataReceiveClient.Abort();
                Console.WriteLine(exception.Message);
                throw;
            }

            finally
            {
                Console.Read();

            }
<security mode="TransportCredentialOnly">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>