title: Calling all kind of web services with same code with C#?
body: <p>I want to ask about one situation. We think about written same web service with different technology. For example web api web service,.asmx web service,wcf web service, java xml web service... etc.
  Normally if i want to call this web services i should write different code. 
  Is it possible to call this kind of tech services with same code? How can i do ? 
  Below code is a dummy code to call different type of tech's services. </p>
  
  <pre><code>    //calling web api web service
  
      client.BaseAddress = new Uri("http://localhost:9000/");
      client.DefaultRequestHeaders.Accept.Clear();
      client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml"));
  
      HttpResponseMessage response = await client.GetAsync("api/products/1");
      if (response.IsSuccessStatusCode)
      {
          Product product = await response.Content.ReadAsAsync&gt;Product&gt;();
          Console.WriteLine("{0}\t${1}\t{2}", product.Name, product.Price, product.Category);
      }
  
      //calling asmx web service
  
      localhost.WebService client = new localhost.WebService();
      client.Products(1); 
  </code></pre>
  
  <p>Edit: All web service have same method and property</p>