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