WCF示例(3) - 绑定Binding(basicHttpBinding和netTcpBinding)2012-01-20 webabcd 介绍WCF(Windows Communication Foundation) - 绑定Binding:Http以basicHttpBinding为例,Tcp以netTcpBinding为例。示例1、服务IHello.cs
using System;using System.Collections.Generic;using System.Linq;using System.Text; using System.ServiceModel; namespace WCF.ServiceLib.Binding{ /**//// <summary> /// IHello接口 /// </summary> [ServiceContract] public interface IHello { /**//// <summary> /// 打招呼方法 /// </summary> /// <param name="name">人名</param> /// <returns></returns> [OperationContract] string SayHello(string name); }}