wcfweb-confignet.tcp

Calling Action: ContractFilter mismatch at the EndpointDispatcher


I'm looking at this issue for hours. I try to get a WCF service running and now it comes down to a ContractFilter-Mismatch-Error with the Action "http://tempuri.org/ISystemService/LogIn". Here is the relevant part of the client config:

<bindings>
  <netTcpBinding>
    <binding name="netTcpBindingConfig_TimeRegistrationSystemService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
            <security mode="Transport">  
                <transport clientCredentialType="Windows" />  
            </security>
        </binding>
        <binding name="netTcpBindingConfig_SystemService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
            <security mode="Transport">  
                <transport clientCredentialType="Windows" />  
            </security>
        </binding>
  </netTcpBinding>    
</bindings>
<client>
  <endpoint address="net.tcp://mysrv.myteam.local:54520/MyCompany.Services.TimeRegistrationSystemService.svc" binding="netTcpBinding" bindingConfiguration="netTcpBindingConfig_SystemService" contract="SystemService.ISystemService" name="NetTcpBindingBinding_ISystemService" />
  <endpoint address="net.tcp://mysrv.myteam.local:54520/MyCompany.Services.SystemService.svc" binding="netTcpBinding" bindingConfiguration="netTcpBindingConfig_TimeRegistrationSystemService" contract="TimeRegistrationSystemService.ITimeRegistrationSystemService" name="NetTcpBindingBinding_ITimeRegistrationSystemService" />      
</client> 

and here the server's config - binding configuration:

<bindings>
    <netTcpBinding>
        <binding name="netTcpBindingConfig_OtherInterfaceService">
            <security mode="Transport">  
                <transport clientCredentialType="Windows" />  
            </security>
        </binding>
        <binding name="netTcpBindingConfig_TimeRegistrationSystemService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
            <security mode="Transport">  
                <transport clientCredentialType="Windows" />  
            </security>
        </binding>
        <binding name="netTcpBindingConfig_SystemService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
            <security mode="Transport">  
                <transport clientCredentialType="Windows" />  
            </security>
        </binding>
  </netTcpBinding>      
</bindings>

server's config - services:

<service name="MyCompany.Services.EasyLogicInterfaceService" behaviorConfiguration="release">
    <endpoint address="" binding="netTcpBinding" bindingConfiguration="netTcpBindingConfig_EasyLogicInterfaceService" contract="MyCompany.Services.IEasyLogicInterfaceService">          
    </endpoint>        
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://mysrv.myteam.local:54520/MyCompany.Services.EasyLogicInterfaceService.svc/" />
      </baseAddresses>
    </host>
  </service>
  <service name="MyCompany.Services.TimeRegistrationSystemService" behaviorConfiguration="release">
    <endpoint address="" binding="netTcpBinding" bindingConfiguration="netTcpBindingConfig_TimeRegistrationSystemService" contract="MyCompany.Services.ITimeRegistrationSystemService">          
    </endpoint>        
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://mysrv.myteam.local:54520/MyCompany.Services.SystemService.svc/" />
      </baseAddresses>
    </host>
  </service>
 <service name="MyCompany.Services.SystemService" behaviorConfiguration="release">
    <endpoint address="" binding="netTcpBinding" bindingConfiguration="netTcpBindingConfig_SystemService" contract="MyCompany.Services.ISystemService">          
    </endpoint>        
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://mysrv.myteam.local:54520/MyCompany.Services.SystemService.svc/" />
      </baseAddresses>
    </host>
  </service>

and the behaviors:

<serviceBehaviors>
    <behavior name = "debug">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
    <behavior name = "release">
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>

I first thought it might be a typo but I don't find it (am I blind?!?). I already updated my service references in the client solution and published both, the server code and the client code, afterwards. And also, I already put all relevant strings in the client config from the server config (binding configuration, endpoint addresses etc.) by copy'n'paste to avoid a typo.

Than I run through a lot of answers here on stackoverflow without finding any solving my problem.

I can run the client and the server code locally without problems. The problems occur only after deployment.

Tracking the call by system.diagnostics doesn't reveal something else than this error message.

Do you see more than I do or do you know any issues which triggers this errors? When this error comes up, a connection between the client and the server already is successfully established, right? So it cannot be a problem with Kerberos or something...

I apologize in advance if it turns out that it really is just a typo. But I don't find any...

Best regards!


Solution

  • <client>
      <endpoint address="net.tcp://mysrv.myteam.local:54520/MyCompany.Services.TimeRegistrationSystemService.svc"... contract="SystemService.ISystemService" name="NetTcpBindingBinding_ISystemService" />
      <endpoint address="net.tcp://mysrv.myteam.local:54520/MyCompany.Services.SystemService.svc"... contract="TimeRegistrationSystemService.ITimeRegistrationSystemService" name="NetTcpBindingBinding_ITimeRegistrationSystemService" />      
    </client>
    

    The client config endpoints have reverse contract.

    As per your service.config, For the TimeRegistrationSystemService.svc the contract should be ITimeRegistrationSystemService and for SystemService.svc the contract should be ISystemService.