WCF-客户端是否必须具有与端点相同的行为?

WCF-客户端是否必须具有与端点相同的行为?,wcf,wcfserviceclient,wcf-behaviour,Wcf,Wcfserviceclient,Wcf Behaviour,我有以下WCF端点配置: <service behaviorConfiguration="MyNamespace.ContainerManagementServiceBehavior" name="MyNamespace.ContainerManagementService"> <endpoint address="" binding="basicHttpBinding" name="ContainerManagementbasicHt

我有以下WCF端点配置:

      <service behaviorConfiguration="MyNamespace.ContainerManagementServiceBehavior"
    name="MyNamespace.ContainerManagementService">
    <endpoint address="" binding="basicHttpBinding"
       name="ContainerManagementbasicHttpEndpoint" contract="MyNamespace.IContainer"/>                  
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>      
   <behaviors>      
    <behavior name="MyNamespace.ContainerManagementServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
</behaviors>
<client>
  <endpoint address="http://localhost:3227/Services/ContainerManagementService.svc"
    binding="basicHttpBinding" 
    contract="MyNamespace2.IAQSIDMService" name="externalService" />
</client>
调用端点时,会收到以下错误消息:

{“带操作的消息”http://IMyService/CreateContainer由于EndpointDispatcher上的ContractFilter不匹配,无法在接收器上处理。 这可能是因为合同不匹配(发送方和接收方之间的操作不匹配)或发送方和接收方之间的绑定/安全不匹配。请检查发送方和接收方是否具有相同的合同和绑定(包括安全要求,例如消息、传输、无)。”

这可能是因为我的客户端没有与端点相同的serviceBehavior吗?还有什么我可以错过的吗


谢谢

异常会准确地告诉您出了什么问题。您是否在请求的双方使用相同的合同?绑定和安全性是否相同

如果您能够首先响应这些查询,我们应该能够看到请求失败的原因。您还应该在服务上启用跟踪,并查看发出的错误/警告级别跟踪。这也有助于您诊断问题

var svc = new AQSIDMServiceClient(Constants.External_Service_ConfigurationName, serviceAddress);