webservice中WebMethod的属性
来源:互联网 发布:使用ip连接mysql数据库 编辑:程序博客网 时间:2024/06/02 17:20
WebMethod有6个属性:
.Description
.EnableSession
.MessageName
.TransactionOption
.CacheDuration
.BufferResponse
.Description
.EnableSession
.MessageName
.TransactionOption
.CacheDuration
.BufferResponse
1Description:
是对webservice方法描述的信息。就像webservice方法的功能注释,可以让调用者看见
的注释。
是对webservice方法描述的信息。就像webservice方法的功能注释,可以让调用者看见
的注释。
2EnableSession:
指示webservice是否启动session标志,主要通过cookie完成的,默认false。
指示webservice是否启动session标志,主要通过cookie完成的,默认false。
3MessageName:
主要实现方法重载后的重命名:
主要实现方法重载后的重命名:
4TransactionOption:
指示 XML Web services 方法的事务支持。
指示 XML Web services 方法的事务支持。
5CacheDuration:
Web支持输出高速缓存,这样webservice就不需要执行多遍,可以提高访问效率,
而CacheDuration就是指定缓存时间的属性。
Web支持输出高速缓存,这样webservice就不需要执行多遍,可以提高访问效率,
而CacheDuration就是指定缓存时间的属性。
6BufferResponse
配置WebService方法是否等到响应被完全缓冲完,才发送信息给请求端。普通应用要等完
全被缓冲完才被发送的!看看下面的程序:
配置WebService方法是否等到响应被完全缓冲完,才发送信息给请求端。普通应用要等完
全被缓冲完才被发送的!看看下面的程序:
C#:
[WebMethod(BufferResponse=false)]
public void HelloWorld1()
{
int i=0;
string s="";
while(i<100)
{
s=s+"i<br>";
this.Context.Response.Write(s);
i++;
}
return;
}
public void HelloWorld1()
{
int i=0;
string s="";
while(i<100)
{
s=s+"i<br>";
this.Context.Response.Write(s);
i++;
}
return;
}
[WebMethod(BufferResponse=true)]
public void HelloWorld2()
{
int i=0;
string s="";
while(i<100)
{
s=s+"i<br>";
this.Context.Response.Write(s);
i++;
}
return;
}
public void HelloWorld2()
{
int i=0;
string s="";
while(i<100)
{
s=s+"i<br>";
this.Context.Response.Write(s);
i++;
}
return;
}
从两个方法在ie里执行的结果就可以看出他们的不同,第一种,是推技术哦!
有什么数据马上返回,而后一种是把信息一起返回给请求端的。
有什么数据马上返回,而后一种是把信息一起返回给请求端的。
- webservice中WebMethod的属性
- WebService中webmethod的六个属性
- webservice 中WebMethod属性详解
- webservice 的WebMethod的属性
- .net 下webservice 的WebMethod的属性
- 在ASP.NET WebService 中如何使用 WebMethod 属性
- WebService注释特性类WebMethod的属性详解
- C# WebMethod中属性详解
- C# WebMethod中属性详解
- C# WebMethod中属性详解
- WebService的WebMethod参数为类
- 【WebService】WebMethod特性
- .Net下WebMethod属性
- .Net下WebMethod属性
- .NET 使用 WebMethod 属性
- .net下WebMethod属性
- WebMethod属性详解
- 使用 WebMethod 属性
- 896M 的谜思
- 一键开启局域网共享
- FIFO 和普通文件
- 动态调用WebService(C#)
- 修改sql服务器名称(保持与电脑名同步)
- webservice中WebMethod的属性
- c#委托 跳出线程
- 解决office07 只显示图片框的问题
- c#生成高质量缩略图
- 带你学习Jquery(二):选择器
- c#光棒效果
- c#读写INI文件
- c#邮件发送操作类
- String类剖析