简体   繁体   English

WCF异步操作未提供输出

[英]WCF Async operation not giving output

I am calling WCF Service in xamarin, below is my code 我正在xamarin中调用WCF服务,下面是我的代码

res = Task.Factory.FromAsync((asyncCallback, asyncState) =>
                               _client.BeginMagic(req, asyncCallback, asyncState),
                             (asyncResult) =>
                               _client.EndMagic(asyncResult),null ).Result;

if I use the Proxy class generated using Svcutil.exe this code gives perfect output. 如果我使用通过Svcutil.exe生成的Proxy类,则此代码将提供完美的输出。 Now i have added ServiceReference to access the service. 现在,我已添加ServiceReference来访问该服务。 but it is not giving me output. 但它没有给我输出。 see the screenshot , it shows children could not be evaluated. 看到屏幕截图,它表明孩子们无法被评估。

在此处输入图片说明

Can anyone please help on this ? 有人可以帮忙吗?

假设您的方法名是GetRecords()那么可能会存在类似GetRecordsCompleted的事件,如果存在则必须将其绑定。由于在Silverlight项目中引用了WCF服务后,会为每个服务方法创建事件。在Xamarin中。

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

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