WebMethod is an attribute that is used in Web Service to inform the CLR that particular method will expose as a part of Xml Webservice. WebMethod attribute has some properties which can be sued to control the behavior of the WebMethod.
BufferResponse :- By default it’s value is true. If it true, Response of webmethod serialized and stored in a buffer. When buffer is full or response completed than it sends the data to the client. Thus minimize communication between the worker process and IIS (Internet Information Services) process. If it is false, ASP.NET buffers the responses in chunks of 16 KB while communicating to the client.In case of large file make it false.
Ex:- Suppose we have requested 64 KB file from web service. If BufferResponse is true and Method generating 8 KB data in one go. Than Webserive will not send this 8 KB data to host but Buffer this 8 KB data until unless buffer is full or whole file is completed. And if BufferResponse is false than Webservice buffer this 8 KB data and wait for second call after the second call when data is 16 KB than it sends it to the host.
Cache Duration :- When we call a web method. Web Service cache the response of each unique set of parameter for a time span. This time span is set by Cache Duration property.By default value is zero which means no caching.
Description :- You specify what a web method will do. This will appear on the service help page.Default value is empty string.
Enable Session :- If you want to use Session in Web Service you have to set this property as true. By default value is false. You can use session in web service through HttpContext.Current.Session or with the WebService.Session property if it inherits from the WebService base class.
MessageName :- If you want to overload a WebMethod than you can use this property to uniquely identified a WebMethod. By default value is method name.
Subscribe to:
Post Comments (Atom)
Followers
Link
Labels
Agille
(3)
Angular 2
(96)
Architecture
(7)
ASP .Net
(30)
C#/VB .Net
(161)
Entityframework
(11)
General
(33)
Git
(2)
Hosting
(2)
HTML
(4)
Interview
(12)
Interview-Agile
(1)
Interview-Angular
(25)
Interview-ASP .Net
(3)
Interview-C#
(16)
Interview-JavaScript
(1)
Interview-MVC
(30)
Interview-SQL Server
(4)
Interview-WCF
(2)
Islam
(6)
Java Script
(37)
JQuery
(1)
MVC
(53)
NodeJS
(1)
Puzzles
(1)
React-Native
(3)
Security
(1)
Shayri
(10)
SQL Server
(41)
VC++
(5)
WCF
(21)
Web API
(27)
WPF
(21)
No comments:
Post a Comment