title: Video streaming in web service c#
body: <p>Here is my code for web service i made:</p>
  
  <pre><code> public class WebService1 : System.Web.Services.WebService
  {
      [WebMethod]
      public List&lt;UploadFile&gt; GetUploadedFiles()
      {
          using (Database1Entities1 SampleDb = new Database1Entities1())
          {
              return SampleDb.UploadFiles.ToList();
          }
      }
  
      [WebMethod]
      public void ViewData(int File_ID)
      {
          using (Database1Entities1 SampleDb = new Database1Entities1())
          {
              var File = SampleDb.UploadFiles.Where(f =&gt; f.Id.Equals(File_ID)).FirstOrDefault();
  
              if (File != null)
              {
                  HttpContext.Current.Response.ContentType = File.ContentType;
                  HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=" + File.Name);
                  HttpContext.Current.Response.BinaryWrite(File.Content);
                  HttpContext.Current.Response.Flush();
                  HttpContext.Current.Response.End();
              }
          }
       }
       }
        }
  </code></pre>
  
  <p>This service returns the dataset containing videos when i stream them at separate webform instead of calling it through client it works properly but when i call it through client service it does not stream videos. any one??</p>