我需要在通用Windows平台中访问WCF服务而不添加服务引用。我尝试创建如下的频道。
var binding = new BasicHttpBinding();
var address = new EndpointAddress("http://localhost:4684/Service1.svc");
var factory = new ChannelFactory<IMyService>(binding, address); //getting exception in this line.
var channel = factory.CreateChannel();
我也在web.config
文件中做了相应的更改。
但我得到了这个例外:
加载&#34; ServiceContractAttribute&#34;时发生错误在类型&#34; IMyService&#34;。
请注意,我的WCF服务应用程序中没有此IMyService
接口。 IMyService
接口位于单独的程序集中,并在此WCF服务中实现。
任何人都可以帮我解决UWP中的这个问题并访问我的WCF服务吗?