title: web service in ASP .Net MVC application
body: <p>I want to add a web service to asp .net mvc application as a model
  any one has an idea how to do this ? </p>
  
  <p>i wrote my web service:</p>
  
  <pre><code>public class WebService : System.Web.Services.WebService
  {
  
      [WebMethod]
      public string HelloWorld()
      {
          return "Hello World";
      }
  
     [HttpPost]
     [WebMethod(EnableSession = true)]
      public string GetData(IDictionary&lt;string, string&gt; inputParam)
      {
          MusicStoreEntities db = new MusicStoreEntities();
          List&lt;Category&gt; categoriesList = new List&lt;Category&gt;();
          List&lt;Song&gt; songsList = new List&lt;Song&gt;();
          String sJSON = " ";
  
  
          int ID = 0 ;
          if (inputParam.ContainsKey("categoryId") ){
              ID = Int32.Parse(inputParam["categoryId"]);
          }
  
          if (ID == 0)
          {
  
              categoriesList = db.Albums.ToList();
              var oSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
              sJSON = oSerializer.Serialize(categoriesList);
  
          }
          else {
              songsList = db.SongList.Where(d =&gt; d.categoryId == ID).ToList();
              var oSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
              sJSON = oSerializer.Serialize(songsList);
          }
  
          return sJSON;
  
      } 
  }
  </code></pre>
  
  <p>this web service must me invoked by android application </p>
  
  <p>Any help ?</p>