WCF wsHttpBinding安全错误

时间:2012-08-30 12:41:10

标签: wcf wcf-security

我在Windows服务中托管了WCF并使用用户域帐户运行。

域中的所有客户端(控制台应用程序或Web应用程序)都能正常运行。

我有一个不在域中的控制台应用程序。

Herei是错误:

Exception non gérée : System.ServiceModel.Security.SecurityNegotiationException:
L'appelant n'a pas été authentifié par le service. ---> System.ServiceModel.Fau
ltException: The request for security token could not be satisfied because authe
ntication failed.

以下是WCF服务器配置:

      <wsHttpBinding>
        <binding name="TransactionalBind" transactionFlow="true"/>
      </wsHttpBinding>

[...]

    <endpoint address="http://machine.domain.fr:1083/MyService/"
              binding="wsHttpBinding"
              bindingConfiguration="TransactionalBind"
              contract="MyService.IMyService"/>
[...]

    <behavior name="MyBahavior">
      <serviceMetadata httpGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="True" />
      <dataContractSerializer maxItemsInObjectGraph="2147483647" />
    </behavior>

这是我的客户端配置:

        <wsHttpBinding>
            <binding name="WSHttpBinding_IMyService" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                bypassProxyOnLocal="false" transactionFlow="true" 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" />
                </security>
            </binding>
        </wsHttpBinding>
[...]

        <client>
            <endpoint address="http://machine.domain.fr:1083/MyService/"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMyService"
                contract="wsArchi.IMyService" name="WSHttpBinding_IMyService">
            </endpoint>
        </client>

你能帮我吗?

非常感谢

1 个答案:

答案 0 :(得分:-1)

尝试使用BasicHttpBinding ... 当我使用WSHttpBinding时,我遇到了问题.... BasicHttpBinding解决了我的问题。!!!