带有Xamarin Forms和WCF服务的Windows Phone 8.1

时间:2015-05-29 16:33:23

标签: wcf windows-phone-8.1 xamarin.forms

Windows Phone 8.1与WCF服务之间是否存在任何不兼容性?

我正在开发一个使用WCF服务的Xamarin Forms App Portable,在Android上工作正常但在Windows Phone 8.1中无法正常运行且没有错误或例外。

我从Visual Studio添加服务引用并以这种方式使用它:

IServicioWeb service = new ServicioWebClient();

var res = servicio.BeginMyValidateMethod(param1, param2, null, null);
var res_client = servicio.EndMyValidateMethod(res);

1 个答案:

答案 0 :(得分:0)

您必须使用REST实现,因为它说here

  

Windows Phone 8.1 XAML应用程序不支持   System.ServiceModel命名空间,因此您无法正确使用   单击项目中的引用,然后选择“添加服务引用”   建议的解决方案是向WCF添加REST端点   端点,并通过REST端点访问WCF应用程序   使用HttpClient。