【发布时间】:2016-05-24 22:11:06
【问题描述】:
我是 C# 的初学者,我的 Visual Studio 是 2010,我的 Windows Phone 7 版本是在互联网上研究的,在这个版本的命令“async”中只适用于 Visual Studio 12 以上。
你还有其他选择吗?
我可以将 webservice 与引用服务映射,但返回总是为零,但在 Android 工作中,错误可能是什么?
我更改了代码以保持他告诉我的状态,但错误继续发生: 解组错误:意外元素(uri:“webservices.com.br/”;站点:“parameter1”)。预期的元素是 、 以下源代码:
public partial class MainPage : PhoneApplicationPage{
wsServico.cadastroTo cadastroTo = null;
public MainPage(){
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e){
wsServico.TesteJavaWsClient ws = new wsServico.TesteJavaWsClient();
ws.returnServicoAsync("A", "B");
ws.returnServicoCompleted += new EventHandler<wsServico.returnServicoCompletedEventArgs>(ws_returnServicoCompleted);
}
void ws_returnServicoCompleted(object sender, wsServico.returnServicoCompletedEventArgs e){
cadastroTo = e.Result;
textBox1.Text = cadastroTo.cadastroId.ToString();
}
}
【问题讨论】:
-
尝试添加这个旧的Async CTP via NuGet,您将使用 Async/Await。
-
本站Nugget下载页面,没有Visual Studio 2010的版本,怎么办?
-
这里是a post from MSDN on the Async CTP v3,尝试下载旧的安装程序,看看它是否有效 - 另外,你必须使用WP7,为WP8甚至Win10手机开发会更有意义吗?跨度>
-
我设法解决了这个问题,谢谢。
标签: c# windows-phone-7