简体   繁体   中英

WCF- ContractFilter mismatch at the EndpointDispatcher

I have this WCF exception. I've checked this SO question, but I'm still not sure of what's wrong

Actual exception message-

The message with Action 'http://tempuri.org/ITramsApplicationService/GetAllApplications' 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).

I've tried to modify my binding configuration on both the client and the WCF service, but that didn't help

Config at WCF Service-

<basicHttpBinding>
        <binding name="FileServiceConfiguration" 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="1638400" maxArrayLength="2097152" maxBytesPerRead="409600" maxNameTableCharCount="1638400" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>

    <service behaviorConfiguration="Default" name="Tavisca.TramsFileService.ServiceImplementation.TramsApplicationServiceImpl">
            <endpoint address=""  binding="basicHttpBinding"
              bindingConfiguration="FileServiceConfiguration" contract="Tavisca.TramsFileService.ServiceContracts.ITramsApplicationService" />
          </service>

Config for client/consumer-

<endpoint address="http://localhost:20020/TramsFileService.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITramsApplicationService"
                contract="TramsFileServices.ITramsApplicationService" name="BasicHttpBinding_ITramsApplicationService" />


<binding name="BasicHttpBinding_ITramsApplicationService" 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="1638400" maxArrayLength="2097152" maxBytesPerRead="409600" maxNameTableCharCount="1638400"  />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>

In general case it means that receiver could not process the message because it did not match any of the contracts the receiver has configured for the endpoint which received the message.

  • Check the folowing things:
    1. Contracts of client and sender must be same.
    2. Bindings between client and sender.
    3. The message security settings are must be consistent between client and sender.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM