我正在为窗口电话调用asmx Web服务。这是我的代码。当我执行此代码时,它给出了错误:
ArgumentException:无效的appId 参数名称:appId:ID = 3010.V2_Soap.Translate.3C775314
private void button1_Click(object sender, RoutedEventArgs e)
{
ServiceReference1.LanguageServiceClient myclient = new ServiceReference1.LanguageServiceClient();
myclient.TranslateAsync(AppIdString, textBox1.Text, "en", "fr", "text/plain", "general");
myclient.TranslateCompleted += new EventHandler<ServiceReference1.TranslateCompletedEventArgs>(translatecompleted);
}
private void translatecompleted(object obj, ServiceReference1.TranslateCompletedEventArgs e)
{
textBlock1.Text = e.Result.ToString();
}
答案 0 :(得分:0)
private void button1_Click(object sender, RoutedEventArgs e)
{
jomarzi.ServiceSoapClient obj = new jomarzi.ServiceSoapClient();
obj.HelloWorldCompleted +=new EventHandler<jomarzi.HelloWorldCompletedEventArgs>(obj_HelloWorldCompleted);
obj.HelloWorldAsync();
}
private void obj_HelloWorldCompleted(object sender, jomarzi.HelloWorldCompletedEventArgs e)
{
textBlock1.Text = e.Result;
}