一
A
示例
WebService ws = new WebService();
string s = ws
B
指定WEB引用名
示例:
kk
string ss=n
二
<asp:ScriptManager runat=
<Services>
<asp:ServiceReference Path=
</Services>
</asp:ScriptManager>
<script type=
function a()
{
WebService
}
//這裡的onresult是回調函數
function onresult(result)
{
alert(result);
}
function b()
{
WebService
}
function onreturn(result)
{
alert(result);
}
//下面的
function c()
{
WebService
}
function onresultC(res
{
alert(res);
alert(c);
}
//onerror是獲得異常信息的回調函數
function onerror(error)
{
var a=
a=String
跟蹤信息:{
error
error
error
error
error
alert(a);
}
a();
b();
c();
</script>
web Service
[WebMethod]
public string HelloWorld() {
return
}
[WebMethod]
public int AddWwg(int a
{
return a + b;
}
exe
using CallWebService
namespace CallWebService
{
public partial class Form
{
public Form
{
InitializeComponent();
}
private void button
{
Service serviceWwg = new Service();
int i
int i
int iResult = serviceWwg
lb
}
private void button
{
CallWebService
string strResult = serviceWwg
lb
}
}
}
From:http://tw.wingwit.com/Article/program/net/201311/11771.html