title: How can i return JSON from WCF Web service?
body: <p>I've a wcf web service that normally returns DataTable. I serialized it with Newtonsoft.JSON but it is returning it in string marks i mean ' " ' marks. And thats why i can not use it in Android. </p>
  
  <p>I've tried return object but nothing changed. I tried change response format or something like it but it is still same.</p>
  
  <p>Here is my WCF Interface Code </p>
  
  <pre><code>[WebGet (BodyStyle = WebMessageBodyStyle.Bare,
          ResponseFormat =WebMessageFormat.Json,
          UriTemplate = "GetRecords")]
  </code></pre>
  
  <p>Here is my service code.</p>
  
  <pre><code>     public string btGetTable()
       {
          DataTable dt = new DataTable("ExampleDT");
          dt.Columns.Add(new DataColumn("KODU", typeof(string)));
          dt.Columns.Add(new DataColumn("ACIKLAMA", typeof(string)));
          dt.Columns.Add(new DataColumn("KAPALI_FL", typeof(bool)));
          dt.Columns.Add(new DataColumn("TARIH", typeof(DateTime)));
          dt.Columns.Add(new DataColumn("TUTAR", typeof(Decimal)));
          dt.Columns.Add(new DataColumn("DURUM", typeof(short)));
  
          DataRow dr = dt.NewRow();
          dr[0] = "TLP.00000001";
          dr[1] = "Dummy Record 1";
          dr[2] = false;
          dr[3] = DateTime.Now;
          dr[4] = 1254.78d;
          dr[5] = 0;
          dt.Rows.Add(dr);
  
   string serializedDt = JsonConvert.SerializeObject(dt);
   return serializedDt;
  </code></pre>
  
  <p>Here is the actual output</p>
  
  <pre><code> "[{\"KODU\":\"TLP.00000001\",\"ACIKLAMA\":\"Dummy Record 1\",\"KAPALI_FL\":false,\"TARIH\":\"2018-12-26T11:42:03.2652779\",\"TUTAR\":1254.78,\"DURUM\":0}]"
  </code></pre>
  
  <p>Expected Output </p>
  
  <pre><code> [{"KODU":"TLP.00000001","ACIKLAMA":"Dummy Record 1","KAPALI_FL":false,"TARIH":"2018-12-26T11:42:03.2652779","TUTAR":1254.78,"DURUM":0}]
  </code></pre>