WCF- ContractFilter在EndpointDispatcher上不匹配

时间:2014-03-12 06:20:12

标签: c# wcf exception wcf-binding

我有这个WCF异常。我已经检查了this这个问题,但我仍然不确定错误

实际异常消息 -

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).

我尝试在客户端和WCF服务上修改我的绑定配置,但这没有帮助

在WCF服务上配置 -

<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>

为客户/消费者配置 -

<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>

1 个答案:

答案 0 :(得分:-2)

一般情况下,这意味着接收方无法处理消息,因为它与接收方为接收消息的端点配置的任何合同都不匹配。

  • 检查以下内容:
    1. 客户和发件人的合同必须相同。
    2. 客户与发件人之间的绑定。
    3. 邮件安全设置必须在客户端和发件人之间保持一致。