本节的主要内容:1、通过代理类的方式调用服务操作。2、通过通道的方式调用服务操作。3、代码下载
一、通过代理类的方式调用服务操作(两种方式添加代理类)
1.手动编写代理类,如下:
客户端契约:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; namespace y.WcfFirst.Client.Proxys { [ServiceContract] public interface IHello { [OperationContract] string Say(string name); } }