12,162
社区成员
发帖
与我相关
我的任务
分享
public class TestService
{
private WcfServerConnection db = new WcfServerConnection();
public List<TestData> GetList()
{
var persons = from p in db.TestEntitys
select new TestData
{
ID = p.ID, Conten = p.Content
};
var ulits = persons.ToList();
return ulits;
}
}
public string Test()
{
EndpointAddress edpHttp = new EndpointAddress("http://localhost:57840/");
ClientFactory client = new ClientFactory(new WSHttpBinding(SecurityMode.None), edpHttp);
string temp = client.GetTest().ToString();
return temp;
}
public class ClientFactory:ClientBase<ITest>,ITest
{
public ClientFactory(System.ServiceModel.Channels.Binding binding, EndpointAddress edpAddr)
: base(binding, edpAddr) { }
public void WcfTest() {
;
}
public List<TestData> GetTest()
{
return base.Channel.GetTest();
}
}