Windows phone 7 从windows phone 8调用时,所有wcf方法都返回void
当我在windows phone 8项目中添加wcf服务引用时,所有服务方法都返回void 我已经使用了所有的ASIN并等待Windows phone 7 从windows phone 8调用时,所有wcf方法都返回void,windows-phone-7,windows-phone-8,Windows Phone 7,Windows Phone 8,当我在windows phone 8项目中添加wcf服务引用时,所有服务方法都返回void 我已经使用了所有的ASIN并等待 public async void getdata() { ServiceReference1.BALClient service = new ServiceReference1.BALClient(); var list=await service.Get_ListAsync("SQL");
public async void getdata()
{
ServiceReference1.BALClient service = new ServiceReference1.BALClient();
var list=await service.Get_ListAsync("SQL");
}
Error Error无法将void分配给隐式类型的局部变量不能等待空虚 当我使用Asyn并完成eventArgs时,它也不起作用
public async void getdata()
{
service.helloAsync();
service.helloCompleted += new EventHandler<ServiceReference1.helloCompletedEventArgs>(service_helloCompleted);
}
public void service_helloCompleted(object sender, viceReference1.helloCompletedEventArgs e)
{
string i = e.Result;
}
public异步void getdata()
{
service.helloAsync();
service.helloCompleted+=新事件处理程序(service\u helloCompleted);
}
public void服务\u helloCompleted(对象发送方,viceReference1.helloCompletedEventArgs e)
{
字符串i=e.结果;
}
你能试试类似的方法吗:
ServiceReference1.BALClient.Get_ListCompleted += new EventHandler<Get_ListCompletedEventArgs>(ListFromClientCompleted);
ServiceReference1.BALClient.Get_ListAsync("SQL");
对于某些平台,WCF客户端不会创建任务返回()异步方法。相反,它创建方法
我建议您为EAP方法创建TAP包装。我相信您当前的尝试不起作用的原因是因为您在开始操作后分配了处理程序。一些正在进行的搜索和搜索我得到了解决方案 确保webservice具有计算机IP的完整地址
> http://localhost:6060/Web_new
使用ip地址而不是本地主机
> http://192.160.16.1:6060/Web_new
你能举一个例子吗,我无法理解你推荐的博客,在这个博客里有一个例子。我不确定我是否能把它说得比那个例子更清楚。
> http://192.160.16.1:6060/Web_new