我写了一些需要使用IIS支持SOAP和REST的wcf服务。 SOAP正在运行 - 它没有任何问题。 但是,当我从资源管理器中调用REST时,我收到此消息
<Reason>
<Text xml:lang="en-US">
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).
</Text>
</Reason>
相关的Web.config文件部分:
<service behaviorConfiguration="ServiceBehavior" name="Service.SOAPService">
<endpoint binding="basicHttpBinding" contract="Contracts.ISOAPService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service behaviorConfiguration="ServiceBehavior" name="Service.RESTService" >
<endpoint binding="webHttpBinding" contract="Contracts.IRESTService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
.
.
.
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>