I know what your problem is now.
the problem is that you use:
WebGet(UriTemplate = "NewsById/{NewsID}", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
try it like this:
WebGet(UriTemplate = "NewsById/{NewsID}", ResponseFormat = WebMessageFormat.Json]
it will return the data in this format:
"[{\"NewsID\":3,\"NewsCompId\":2,\"CompanyId\":1,\"CompanyLegalName\":\"demo 1\"},{\"NewsID\":97,\"NewsCompId\":98,\"CompanyId\":99,\"CompanyLegalName\":\"demo 2\"}]"
and you can deserialize this JSON easily with:
JSON.parse("[{\"NewsID\":3,\"NewsCompId\":2,\"CompanyId\":1,\"CompanyLegalName\":\"demo 1\"},{\"NewsID\":97,\"NewsCompId\":98,\"CompanyId\":99,\"CompanyLegalName\":\"demo 2\"}]")
But what I think, you really wanted is this:
[OperationContract]
[WebGet(UriTemplate = "WrappedListNewsById/{value}", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
List<Newss> GetList(string value);
The WCF service is smart enough to serialize the whole list into json for you so you don't have to use
var JsonNews = Newtonsoft.Json.JsonConvert.SerializeObject(Lstnews);
at all.
View my updated github example on:
GitHub - xszaboj/convertToJsonDemo: convertToJsonDemo[
^]