ClientBase<Iservice>和ChannelFactory两种方式都可以创建proxy:

(1)ChannelFactory

using (ChannelFactory<IService1> channelFactory = 
    new ChannelFactory<IService1>("WSHttpBinding_IService1"))
{
    IService1 proxy = channelFactory.CreateChannel();
    using (proxy as IDisposable)
    {
       string a = proxy.GetData(10);
    }
}

 

(2)ClientBase<Iservice>

public class client : ClientBase<IService1>, IService1
{
    public string GetData(int value)
    {
        return "";
    }
}
当把Blog当作一个twitter

相关文章:

  • 2021-10-24
  • 2021-08-11
  • 2022-12-23
  • 2021-10-15
  • 2021-06-07
  • 2021-11-29
猜你喜欢
  • 2021-11-26
  • 2021-07-21
  • 2022-01-25
  • 2021-11-06
相关资源
相似解决方案