1

別の Web サイトでホストされている wcf サービスに asp.net ページをバインドしようとしていますが、

クライアントの web.config ファイルには次のコードがあります。

<endpoint address="http://localhost:1670/webhost/CustomersService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding_ICustomersService" contract="CustomersService.ICustomersService" name="BasicHttpBinding_ICustomersService"/>
</client>

サービスの web.config ファイルには次のコードがあります。

<endpoint address="" binding="wsHttpBinding" contract="CustomerServiceLibrary1.ICustomersService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>

エラーは次のとおりです。

エラー 1 Reference.svcmap: system.serviceModel/bindings/wsHttpBinding のバインディングには、'wsHttpBinding_ICustomersService' という名前の構成済みバインディングがありません。これは bindingConfiguration の無効な値です。(C:\Users\Lara\Documents\Visual Studio 2010\Projects\CustomerServiceDemo\WebClient\web.config 行 25) App_WebReferences/CustomersService/.

4

2 に答える 2

1

クライアント構成の次の部分 bindingConfiguration="wsHttpBinding_ICustomersService"

「wsHttpBinding_ICustomersService」という名前のバインディング構成を使用する必要があることを示しています。クライアントの web.config にその名前のバインディング構成がありますか?

次の記事では、WCF とバインドについて説明しています http://msdn.microsoft.com/en-us/magazine/cc163394.aspx

しかし、この部分はあなたが探しているものでなければなりません

<configuration>
  <system.serviceModel>
    <services>
      <service name=”ChatService”&gt;
        <endpoint address=”http://localhost:8080/chat” 
          binding=”basicHttpBinding” 
          bindingConfiguration=”basicConfig” 
          contract=”ChatLibrary.IChat” />
        ...
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
        <binding name=”basicConfig” messageEncoding=”Mtom”&gt;
          <security mode=”Transport”/>
        </binding>
      </basicHttpBinding>
      ...
    </bindings>
  </system.serviceModel>
</configuration>

「バインディング」セクションに注意してください

于 2012-06-25T11:33:51.770 に答える
0

私は同じ例外
を受け取っていました。コードでクライアント側にbasicHttpBindingを持つエンドポイントの名前を指定して追加すると、
私の問題は解決しました

TestServiceClient obj = new TestServiceClient("BasicHttpBinding_ITestService");
于 2013-11-12T07:35:11.197 に答える