简体   繁体   English

Xamarin Forms中的多个WCF连接

[英]Multiple WCF connections in Xamarin Forms

I'm developing an app that connects with WCF service to load data. 我正在开发一个与WCF服务连接的应用程序来加载数据。 I added a Web Service Reference directly from Visual Studio, and runs very well. 我直接从Visual Studio添加了一个Web服务引用,运行得很好。

But, my problem now is this: I have to connect with different WCF services depending the user who login app. 但是,我现在的问题是:我必须根据登录应用程序的用户连接不同的WCF服务。

Exists any way to doing this by code?? 存在任何通过代码执行此操作的方法? I'm using a Xamarin Forms Portable app. 我正在使用Xamarin Forms Portable应用程序。


SOLVED: 解决了:

Finally, I change the url of the service by code: 最后,我通过代码更改服务的URL:

service = new ServicioWebClient(binding, new EndpointAddress("http://myurl/wsdl"));

最后,我通过代码更改服务的URL:

service = new ServicioWebClient(binding, new EndpointAddress("http://myurl/wsdl"));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM