动态创建WCF客户端

时间:2012-09-26 14:33:43

标签: wcf dynamic runtime connect

我想创建一个动态连接器,以连接到我的WCF服务。 我在互联网上找到了以下代码:

BasicHttpBinding basic = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
basic.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
EndpointAddress serviceAddress = new EndpointAddress("http://url.svc");

ServiceClient client = new ServiceClient(basic, serviceAddress);

问题是在这种情况下我需要知道'ServiceClient'是什么。是否可以在没有类型的情况下创建客户端?

0 个答案:

没有答案
相关问题