WCF:呼叫者未通过该服务进行身份验证

时间:2010-01-06 11:53:10

标签: wcf

我刚刚配置了我的第一个服务应用程序,我收到了这个错误:

“来电者未通过该服务验证。”

该服务通过IIS 6.0托管在我的服务器上,我在另一台PC上创建了一个使用此服务的桌面应用程序。奇怪的是,当两个应用程序在同一台PC上时,服务正常工作。我在IIS上启用了匿名用户访问。我已经看了一段时间了,我仍然不知道如何正确配置我的服务和我的客户端应用程序,以便他们进行交互。

请帮助!!

此致

詹姆斯

服务器网络配置:

                                                                                                                                                                                                                                                                                                                                                                                                           

Clint App配置文件:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_ICOPITSERVICE" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>
        </basicHttpBinding>
        <netNamedPipeBinding>
            <binding name="NetNamedPipeBinding_ICOPITSERVICE" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
                hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288"
                maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="Transport">
                    <transport protectionLevel="EncryptAndSign" />
                </security>
            </binding>
        </netNamedPipeBinding>
        <netTcpBinding>
            <binding name="NetTcpBinding_ICOPITSERVICE" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
                hostNameComparisonMode="StrongWildcard" listenBacklog="10"
                maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
                maxReceivedMessageSize="65536">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <reliableSession ordered="true" inactivityTimeout="00:10:00"
                    enabled="false" />
                <security mode="Transport">
                    <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                    <message clientCredentialType="Windows" />
                </security>
            </binding>
        </netTcpBinding>
        <wsHttpBinding>
            <binding name="WSHttpBinding_ICOPITSERVICE" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                allowCookies="false">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <reliableSession ordered="true" inactivityTimeout="00:10:00"
                    enabled="false" />
                <security mode="Message">
                    <transport clientCredentialType="Windows" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="Windows" negotiateServiceCredential="true"
                        algorithmSuite="Default" establishSecurityContext="true" />
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:8080/COPIT_SERVICE/ws" binding="wsHttpBinding"
            bindingConfiguration="WSHttpBinding_ICOPITSERVICE" contract="COPIT_SERVICE.ICOPITSERVICE"
            name="WSHttpBinding_ICOPITSERVICE">
            <identity>
                <dns value="localhost" />
            </identity>
        </endpoint>
        <endpoint address="http://localhost:8080/COPIT_SERVICE/basic"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICOPITSERVICE"
            contract="COPIT_SERVICE.ICOPITSERVICE" name="BasicHttpBinding_ICOPITSERVICE" />
        <endpoint address="net.tcp://localhost:8888/COPIT_SERVICE" binding="netTcpBinding"
            bindingConfiguration="NetTcpBinding_ICOPITSERVICE" contract="COPIT_SERVICE.ICOPITSERVICE"
            name="NetTcpBinding_ICOPITSERVICE">
            <identity>
                <userPrincipalName value="jscott@afis.ad.ucc.ie" />
            </identity>
        </endpoint>
        <endpoint address="net.pipe://localhost/COPIT_SERVICE" binding="netNamedPipeBinding"
            bindingConfiguration="NetNamedPipeBinding_ICOPITSERVICE" contract="COPIT_SERVICE.ICOPITSERVICE"
            name="NetNamedPipeBinding_ICOPITSERVICE">
            <identity>
                <userPrincipalName value="jscott@afis.ad.ucc.ie" />
            </identity>
        </endpoint>
    </client>
</system.serviceModel>

1 个答案:

答案 0 :(得分:0)

正如marc_s所说,你正在使用哪种绑定。

但是这里有几件事情是行不通的:

  • 使用IIS 6不支持netNamedPipes和netTCP绑定。
  • netNamedPipe绑定在计算机之间不起作用。这是设计的。

我猜你正在使用wsHttpBinding,这是使用Windows凭证。然后有2-3个可能的问题:

  • 匿名IIS设置导致客户端未经过身份验证
  • 机器不在域中
  • 客户使用本地帐户登录