WCF クライアントとして機能するコンソール アプリケーションを作成しました。app.config は次のもので構成されます。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="WebHttpBinding_IWebContentService">
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://localhost:1252/SomeService.svc" binding="customBinding" bindingConfiguration="WebHttpBinding_IWebContentService"
contract="WebContentClient.IWebContentService" name="WebHttpBinding_IWebContentService" />
</client>
</system.serviceModel>
</configuration>
実行すると、次のエラーが表示されます。
The address property on ChannelFactory.Endpoint was null
エンドポイント要素にはアドレス プロパティがありますが、そのプロパティを何に割り当てればよいかわかりません。localhost で Web サービスを実行しています。
更新 1:
アドレスを追加し、元のコードを更新しました。しかし、address="http://localhost:1252/SomeService.svc" をリッスンしているエンドポイントがなかったというエラーが返されます。wcf url にアクセスすると、Web サービスが表示されます。