0

次の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>

私は動的にWebサービス呼び出しを行っており、別のアドレスを提供しています。

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

エンドポイントを呼び出すと、次のエラーメッセージが表示されます。

{"EndpointDispatcherでのContractFilterの不一致が原因で、アクション'http:// IMyService / CreateContainer'のメッセージを受信者で処理できません。これは、コントラクトの不一致(送信者と受信者の間のアクションの不一致)または送信者と受信者の間のバインディング/セキュリティの不一致。送信者と受信者が同じコントラクトと同じバインディング(メッセージ、トランスポート、なしなどのセキュリティ要件を含む)を持っていることを確認してください。 "}

これは、クライアントがエンドポイントと同じserviceBehaviorを持っていないという事実が原因でしょうか?私が見逃している可能性のあるものは他にありますか?

ありがとう!

4

1 に答える 1

0

例外は、何が悪いのかを正確に示します。リクエストの両側で同じ契約を使用していますか?バインディングとセキュリティは同じですか?

これらのクエリに最初に応答できれば、リクエストが何に失敗しているかを確認できるはずです。また、サービスでトレースを有効にして、どのエラー/警告レベルのトレースが発行されるかを確認する必要があります。これは、問題の診断にも役立つはずです。

于 2011-03-30T18:40:09.147 に答える