积极答复者
UWP+WebService VS2017

问题
答案
-
您好,
在UWP中添加了WCF引用后,会自动把方法包装成异步的方法,比如说GetData()方法,在你实际调用的时候应该是GetDataAsync()方法。
ServiceReference1.Service1Client client = new ServiceReference1.Service1Client(); string result = await client.GetDataAsync(Convert.ToInt32(tbox.Text));
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- 已标记为答案 若空 2017年8月10日 7:46
全部回复
-
Hi,
因为你的问题涉及UWP,我将把帖子移到UWP论坛。
Best Regards,
Hart
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
-
您好,
在UWP中添加了WCF引用后,会自动把方法包装成异步的方法,比如说GetData()方法,在你实际调用的时候应该是GetDataAsync()方法。
ServiceReference1.Service1Client client = new ServiceReference1.Service1Client(); string result = await client.GetDataAsync(Convert.ToInt32(tbox.Text));
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.- 已标记为答案 若空 2017年8月10日 7:46
-
您好,
如果想你说的那样的话,那这个问题就比较奇怪了,我需要你提供一下你的WebService代码,或者你可以写一个简单的WebService服务,只要能重现你的问题就行,你可以上传到OneDrive网盘上,这样我可以帮你测试一下,看看问题出在哪里。
谢谢
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.