I have a WCF service with an operationContract;
[OperationContract]
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json)]
TrainLines GetLines();
Train lines is;
[DataContract]
public class TrainLines
{
[DataMember]
public List<string> Name { get; set; }
}
In the web config I have defined the binding as {basicHttpBinding}.
Now I am trying to consume that via jquery but I get the errors 200 and 400;
jQuery.support.cors = true;
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: "http:/Domain/WebService/GetLines",
dataType: "json",
success: function (msg) {
ServiceSucceeded(msg);
},
error: ServiceFailed
});