日期:2014-05-20 浏览次数:21017 次
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