Hi, I have a WCF Rest 4.0 project. For some reason, I have a webservice that Json should return, and it does if I am at the endpoint on top of the script, but through firefox or chrome if I type the address that I get xml. What's happening???
Thanks for any help! Here is the code.
Web service:
[OperationContract] [WebGet(UriTemplate = "", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] public SomeObject [] GetObjects() { .....
Object Code:
[DataContract] public class SomeObject { [DataMember] public string Date { get; private set; } .... public String Site { get; private set; }
json c # wcf
Luke belbina
source share