Facts about Web Services

1. Web service class can have overloaded constructors (parameterized) but client can use only default parameter less constructor to instantiate web service object.
2. service constructor(s) can not be made web method using “WebMethod” attribute.
3. If web services is updated then the client needs to updated the web reference to get the changes reflected in the proxy class and if the change affecting any web method call in the client then client needs to be rebuilt after code change as well.
4. Web methods can have public, private, protected, internal and protected internal access modifiers but only public web method will be exposed to the client.
5. Web service class could be public or internal. [Class can not be declared as private, protected or protected internal].
6. Web method could be declared as virtual method.
7. Public class can not be derived from web service class as it lessens the accessibility of base web service class. But you can derive non public class.
8. Web service class can have non “[WebMethod]” functions as well.
9. Web service class can implement interface and declare implemented interface function as “[WebMethod]” so they can be exposed to clients.
10. Web Method can be declared as static but then it will not be exposed to client.
11. Web Service class can be declared as sealed class.

1 comment:

Anonymous said...

Thanks dude for post.

Nice one ;)