1.

Explain Webmethod Attribute In Asp.net Web Service?

Answer»

Attaching the WebMethod attribute to a Public method indicates that you want the method exposed as part of the XML Web service. The WebMethod attribute tells .NET that a particular public method should be exposed as a web-callable method. The WebMethod attribute has SIX associated properties to DOCUMENT and change the BEHAVIOR of your web method. They are:

  • Description
  • MessageName
  • EnableSession
  • CacheDuration
  • TransactionOption
  • BufferResponse


The FIRST two properties are used to document a web method, while the others affect its behavior.

Attaching the WebMethod attribute to a Public method indicates that you want the method exposed as part of the XML Web service. The WebMethod attribute tells .NET that a particular public method should be exposed as a web-callable method. The WebMethod attribute has six associated properties to document and change the behavior of your web method. They are:


The first two properties are used to document a web method, while the others affect its behavior.



Discussion

No Comment Found