加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

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

发布时间:2020-12-14 02:17:47 所属栏目:Windows 来源:网络整理
导读:存在 Windows Phone 8.1与WCF服务的任何不兼容性? 我正在开发一个使用WCF服务的Xamarin Forms App Portable,在Android中工作正常但在Windows Phone 8.1中无法正常工作且没有错误或异常. 我从Visual Studio添加服务引用并以这种方式使用它: IServicioWeb se
存在 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);

解决方法

您必须使用REST实现,如 here所述:

Windows Phone 8.1 XAML applications does not support the System.ServiceModel namespace,and therefore you are not able to right click references in the project and choose Add Service Reference. The recommended solution is to add a REST endpoint to your WCF endpoint,and access the WCF application through the REST endpoint using HttpClient.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读