在Windows Phone应用程序中使用WCF服务:方法返回void

时间:2013-10-27 10:19:50

标签: wcf windows-phone

我有WCF服务

当我在我的Windows手机应用程序中“添加服务引用”时,一切看起来都不错,但方法返回无效。我测试了这个服务器,例如在WPF应用程序中,它工作并返回我需要但在wp 7/8 app中没有。当然,这个WCF的基本功能是返回数据,因此void方法对我来说完全没用。

1 个答案:

答案 0 :(得分:0)

您可以使用服务AsyncCompleted events.Service将返回completed事件中的数据,如

ServiceReference1.Service1Client clientForTesting = new ServiceReference1.Service1Client();
            clientForTesting.GetDataCompleted += new EventHandler<ServiceReference1.GetDataCompletedEventArgs>(TestCallback);
            clientForTesting.GetDataAsync(testValue);
相关问题