智能设备应用程序中的Web服务调用 [英] Web Service Call in Smart Device Application

查看:104
本文介绍了智能设备应用程序中的Web服务调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们如何在智能设备应用程序中使用Web服务.

当我在Emulation上运行应用程序时,出现以下错误

错误:Web异常
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/HelloWorld",RequestNamespace ="http://tempuri.org/",ResponseNamespace ="http://tempuri.org/",使用= System.Web.Services.Description.SoapBindingUse.Literal,ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
公共字符串HelloWorld(){
object [] results = this.Invoke("HelloWorld",new object [0]);
return((string)(results [0]));
}

Hi,

How can we consume webservice in smart device application.

When I run application on Emulation i got following error

Error:Web Exception
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/HelloWorld", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string HelloWorld() {
object[] results = this.Invoke("HelloWorld", new object[0]);
return ((string)(results[0]));
}

推荐答案

Service obj = new Service();
obj.Url ="http://www.SerivceURL.asmx";
label1 .Text = obj.HelloWorld();
Service obj = new Service();
obj.Url = "http://www.SerivceURL.asmx";
label1 .Text = obj.HelloWorld();


这篇关于智能设备应用程序中的Web服务调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆