I have seen several threads about this error on StackOverflow and elsewhere but, I have been unable to get a solution to my problem.
I have an application that attempts to call out to a web service method. When it calls one method (that provides login validation) it works just fine. Then, when it calls another function (not login/membership related) it generates this error:
The message with Action 'http://tempuri.org/IMyAppData/GetSomeSpecialXML' 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 have rebuilt and republished the web service, then deleted the Service References from the client application and recreated them. I still get the error. Here is the relevant XML from the app.config file of the client application:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMyAppData" 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="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://legolas.vectorcsp.home/MyAppSyncService/MyAppData.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyAppData"
contract="MyAppData.IMyAppData" name="BasicHttpBinding_IMyAppData" />
</client>
</system.serviceModel>
and here is the relevant XML from the web.config file of the web service:
<behaviors>
<serviceBehaviors>
<behavior name="MyAppDataSvc.MyAppDataBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" />
This is all taking place on my local machine. I am just trying to do development on the client application. Can anyone suggest what I might try to discover what the problem is.
Thanks in advance for any advice you can give.
Update: I have done more testing. I have published the web service to a development server, instead of my local machine. I still get the same error. I have been through the config files of the application and the web service, and I can't find any problems. I have compared the web.config file of the newly created web service to the web.config file of a previous version of the web service, and I don't see any problems. I have compared the relevant section of the desktop application's app.config file with a web.config file of an existing client of the web service, and I can't find any discrepancy there.
I have enabled tracing on the desktop application and the web service using Microsoft Service Configuration Editor. When I run the desktop app and the error is thrown, no log files are created in either the web service's directory or the desktop application's directory.
I am at a complete stand-still over this. DOES ANYONE HAVE ANY SUGGESTIONS?
Thanks.
I found the problem.
In the client application's app.config file, the address of the endpoint did not match the address of the service, as listed in configuration.svcinfo. So, the two files were pointing to different instances, and different versions, of the web service.