asp调用Webservice
摘要:参考一下
//****服务器端*******
Service1.asmx里包含下面两个WEBMETHOD
[WebMethod]
public DataSet GetMyProductsDataSet(int userID)//被调用时将返回DATASET序列的XML,此XML主要用于ADO.NET
{
string sql;
DataSet ds2=new DataSet();
sql = "select userid,productname from StockIC where UserID="+userID;
my_adapter = new SqlDataAdapter(sql,this.sqlConnection1);
my_adapter.Fill(ds2,"Stock");
return ds2;
}
[WebMethod]
阅读全文
posted @
2008-11-25 11:17
小角色
阅读(377)
推荐(0)
Web Services(3)---WebMethod和WebService特性
摘要:一、WebMethod特性:用于对方法配置特性 ;包括六种特性:
Description 注释 WebMethod
EnableSession 启用会话状态
MessageName WebMethod的别名
TransactionOption 构建事务性Web服务
CacheDuration 高速缓存WEB服务
BufferResponse 缓存服务器响应
1.Description特性:用于简要描述可以通过Web调用的方法或特性的功能。Description特性的值添加到WSDL和WEB SERVERCES 服务帮助页在中。
C# [WebMethod(Description="[string]")]
2.EnableSession特性 会话状态在默认情况下是楚用的,为了启用会话状态支持,可以将EnableSession=ture
C#[WebMethod(EnableSession="[true/false]")]
3.WebMethod的别名
阅读全文
posted @
2008-11-25 11:00
小角色
阅读(334)
推荐(0)