智能设备应用程序中的Web服务调用 [英] Web Service Call in Smart Device Application
问题描述
我们如何在智能设备应用程序中使用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屋!