Visual Studio ジェネレーター
クライアント プロジェクトを右クリックし、Service Reference
. サービス URL を入力するか、ソリューション内から検索できるダイアログがあります。
クライアントの作成
から継承したクライアント クラスを構築できますClientBase<ISecurityManager>, ISecurityManager
。このクライアント クラスでの操作例:
public void ExampleMethod(int id)
{
Channel.ExampleMethod(id);
}
本物の男のように
または、クライアント クラスを使用せずに、次のように呼び出します。
ServiceInvokerinvoker invoker = new ServiceInvoker();
var result = invoker.InvokeService<ISecurityManager, ReturnType>( proxy => proxy.ExampleMethod(1) );
ISecurityManager
すでにクライアントを構成していると仮定した場合の最後の 2 つのオプション:
<client>
<endpoint name="ServiceName"
address="http://ServiceName.test/Service"
binding="basicHttpBinding"
contract="ISecurityManager" />
</client>