熟悉WCF的请进
直接看代码 请问有什么问题
public class StudentMng { StudentContractClient client; public StudentMng() { client = new StudentContractClient(); } ~StudentMng() { client.Close(); } public void Add(Student entity) { client.Add(entity); } public Student GetByID(int id) { return client.GetByID(id); } public void DeleteByID(int id) { client.DeleteByID(id); } public void Update(Student entity) { client.Update(entity); } }
using(SoapClient client = new SoapClient()){ client.Add(entity);}
[解决办法]
不用封装呀,可以实现WCF 拦截器的。
http://blog.csdn.net/fangxinggood/article/details/6144893