문제

I am running a simple service on my server with WCF; the service is hosted in WebDev.WebServer.exe (local).

When I call the Service local I get the following exception:

Unhandled Exception: System.ServiceModel.Security.SecurityNegotiationException: Secure channel cannot be opened because security negotiation with the remote endpoint has failed. This may be due to absent or incorrectly specified EndpointIdentity in the EndpointAddress used to create the channel. Please verify the EndpointIdentity specified or implied by the EndpointAddress correctly identifies the remote endpoint. ---> System.ServiceModel.FaultException: The message with Action 'http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

Here are my two app.config files from the client and the server. I made the app.config from the client with the svcutil-Tool so it should be right:

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>

Server

<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>
도움이 되었습니까?

해결책

모든 SharePoint 2010 설계 프로젝트의 시작에서 지속되는 테리튬을 극복하기 위해서는 재설정 을 의도 한 단순한 Snippet을 만들었습니다. 재설정 기본값에서 상속하는 SharePoint 인터페이스 스타일문서 스타일.

SharePoint 2010 CSS 카일 셰퍼에서 님의보십시오.나는 아직 그것을 테스트하지 않았지만, 당신이 찾고있는 것을 정확하게하는 것 같습니다.

다른 팁

WCF is very powerful, but can be a config nightmare. Here are some potential leads:

  • Turn on the WCF trace logs, rerun your scenario and then check the logs with SvcTraceViewer.exe
  • Figure out how far the messaging gets...
    • i.e. does the client form the request and send it to the server who rejects it (i.e. in the lower WCF layers before your own service code is hit);
    • or does the request get stopped in its tracks before that.. the client never even sending the request
  • http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue is a WS-Trust token-related message, so there'll be something going on with authentication
    • the error's implying that there's a config mismatch, but using SvcUtil should have them lined up like you said
  • The client binding has the server at "http://localhost:1634/UsuarioContexto.svc"
    • I don't see that port specified in the service config... is the service listening on that port?
    • if you open a browser and aim it at that URL, do you get a default service page?
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top