The webmethod attribute provides the following attributes:

Source: Internet
Author: User

Bufferresponse-when set to true (default), ASP. NET caches the entire response before sending the response to the client. Cache is a very effective method. It can improve performance by reducing the communication between auxiliary processes and Internet Information Service (IIS) processes. When set to false, ASP. NET caches the response in the 16 KB block. Generally, this attribute is set to false only when you do not want to cache all the response content in the memory. For example, you are writing back a set of items that are going out of the database. The default value is true unless otherwise specified.

Cacheduration-the value of this attribute specifies the number of seconds required to set the result for each unique parameter in ASP. NET cache. The default value is 0 unless otherwise specified. This setting will disable result caching.
 
Description-the value of this attribute describes the XML Web Services method and is displayed on the service help page. Unless otherwise specified, the default value is a null string.

Enablesession-when set to false (default), ASP. NET cannot access the session Status of the XML Web Services method. When it is set to true, XML Web Services can be directly from httpcontext. current. the Session Access session state set. You can also use WebService when the basic WebService class is inherited. session attribute.
 
Messagename-the value of this attribute enables XML Web Services to use aliases to uniquely identify overload methods. Unless otherwise specified, the default value is the method name. When a value is specified for messagename, The result SOAP message will reflect this name rather than the actual method name.
 
Transactionoption-the value of this attribute specifies whether the XML Web Services method can be used as the root object of the transaction. Although the transactionoption attribute can be set to any value of the transactionoption Enumeration type, there are only two possible actions in the XML Web Services method: it is not involved in transactions (disabled, notsupported, and supported ), or create a new transaction (required and requiresnew ). Unless otherwise specified, the default value is transactionoption. Disabled. To use this attribute, you must add a reference to system. isiseservices. dll. This namespace contains methods and attributes that provide a distributed transaction model that can be found in the COM + service. The system. deleiseservices. contextutil class allows you to set the transaction using the setabort or setcomplete methods.

The method is as follows:
[Webmethod (messagename = "getnewmessage1")]
Function string getnewmessage ()
{
Return "Haha"
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.