ContractFilter mismatch at the EndpointDispatcher
- by Matt
I've created a simple WCF service but when I use Visual Studio to add a service reference, this error comes up.
The message with Action '' 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 is my Interface
[ServiceContract]
public interface IService
{
[OperationContract]
DateTime GetTime();
}
And my implementation
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class TestService : IService
{
public DateTime GetTime()
{
return DateTime.Now;
}
}
Finally here is my web.config
<system.serviceModel>
<client/>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service name="Test.TestService" >
<endpoint address="" contract="Test.IService" binding="basicHttpBinding" >
</endpoint>
</service>
</services>
</system.serviceModel>