Purushottam Rathore
How to make a class accessible as a web service?
By Purushottam Rathore in ASP.NET on Mar 03 2011
  • Purushottam Rathore
    Mar, 2011 3

    By making the class inherits from the System.Web.Services.WebService class.

    By qualifying the class with the WebService attribute 

    Inheriting from the WebService class is beneficiary in that it allows the class to access the ASP.NET context and other useful objects such as the session and application objects. On the other hand, qualifying the class with the WebService attribute allows for setting additional properties of the web service such as its description and namespace.

    C#
        [WebService]
       
    public class TestService : System.Web.Services.WebService

    VB
       
    <WebService> _
       
    Public Class TestService
           
    Inherits System.Web.Services.WebService

     

     

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS