摘要: host by program private void button1_Click(object sender, EventArgs e) { ServiceHost host = new ServiceHost(typeof(PersonService)); WSHttpBinding wsBinding =new WSHttpBinding(); host.AddServiceEndpoint(typeof(IPersonService),wsBinding,new Uri("http://localhost:8766")); host.Opened +=new Ev 阅读全文
posted @ 2013-04-01 23:48 feidaochuanqing 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Service(实现服务契约接口的服务类)namespace Service{ public class PersonService:IPersonService { List<Person> list = new List<Person>(); #region IPersonService 成员 public List<Person> GetAllPerson() { return list; } public void Add(Person person) { list.Add(person); } #endregion }}Contract(服务契约和 阅读全文
posted @ 2013-04-01 22:38 feidaochuanqing 阅读(95) 评论(0) 推荐(0) 编辑