Sometimes when we try to browse our newly hosted website or web service, we encounter with this error. The reason is that we forgot to configure ASP.NET version in the IIS or selected wrong version when we were hosting it.
So now its time to correct this issue, follow these steps:
1. Open IIS management console.
2. Right click on the virtual directory of your web service and choose properties from the shortcut menu.
3. Now click on the ASP.NET tab and choose appropriate ASP.NET version from the dropdown.
4. Now click on Apply button to apply new setting and then click on OK button.
Now try again to access you website/web service, you should be able to do so…
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.
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.