Service WCF SecurityNegotiationException

Je suis en cours d'exécution d'un service simple sur mon serveur avec WCF; le service est hébergé dans WebDev.WebServer.exe (local).

Quand j'ai appeler le Service local-je obtenir de l'exception suivante:

Exception Non Gérée: System.ServiceModel.De sécurité.SecurityNegotiationException: canal Sécurisé ne peut pas être ouvert en raison de la négociation de sécurité avec le point de terminaison distant a échoué. Cela peut être dû à l'absence ou mal spécifié EndpointIdentity dans le EndpointAddress utilisé pour créer le canal.
Veuillez vérifier la EndpointIdentity spécifié explicitement ou implicitement par l'EndpointAddress identifie correctement le point de terminaison distant. ---> Système.ServiceModel.FaultException: Le message de l'Action " http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue ' ne peut pas être
traitées au niveau du récepteur, en raison d'un ContractFilter inadéquation à la EndpointDispatcher. Ce peut être en raison de
soit un contrat d'incompatibilité (décalage des Actions entre l'émetteur et le récepteur) ou une liaison/de la sécurité de l'inadéquation entre l'émetteur et le récepteur. Vérifiez que l'émetteur et le récepteur ont le même contrat et la même liaison (y compris les exigences en matière de sécurité, par exemple, de Message, de Transport, Aucun).

Voici mes deux app.les fichiers de configuration du client et du serveur. J'ai fait de l'application.config du client avec le svcutil-Outil, de sorte qu'il devrait être à droite:

Client

<client>
    <endpoint address="http://localhost:1634/UsuarioContexto.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IUsuarioContexto"

        contract="CarWin.ServiceContracts.Interfaces.IUsuarioContexto" name="LOCAL_WSHttpBinding_IUsuarioContexto">

        <identity><dns value="localhost" /></identity>

    </endpoint>

</client>

<binding name="WSHttpBinding_IUsuarioContexto" 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>

Serveur

<services>
    <service behaviorConfiguration="UsuarioContextoBehavior" name="UserContext.Host.UsuarioContexto">

        <endpoint address="" binding="wsHttpBinding" bindingNamespace="http://CarWin" bindingConfiguration="wsHttpBinding_IUsuarioContexto"

                  contract="CarWin.ServiceContracts.Interfaces.IUsuarioContexto">

            <identity>

                <dns value="localhost" />

            </identity>

        </endpoint>

        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

    </service>

</services>


<bindings>

    <wsHttpBinding>

        <binding name="wsHttpBinding_IUsuarioContexto" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">

            <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxBytesPerRead="2147483647" />

            <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />

            <security mode="None">

                <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />

                <message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true" />

            </security>

        </binding>

    </wsHttpBinding>

</bindings>

<behaviors>

    <serviceBehaviors>

        <behavior name="UsuarioContextoBehavior">

            <serviceMetadata httpGetEnabled="true" />

            <serviceDebug includeExceptionDetailInFaults="true" />

        </behavior>

    </serviceBehaviors>

</behaviors>

OriginalL'auteur Alhambra Eidos | 2010-01-27