Hi,
I need your help, I have the next code
... var url = "http://www.........../Service.svc/"; var test = Ti.Network.createHTTPClient({ onload : function(e) { var data = JSON.parse(this.responseText); var testArray = []; for(var i = 0; i < data.length; i++) { var name = { title : data[i] }; testArray.push(name); } table.setData(testArray); } }); test.open("GET", url); test.send(); ...and the wcf is
IService.cs [ServiceContract] public interface IService { [OperationContract] string GetData(int value); } [DataContract] public class CompositeType { [DataMember] public string StringValue { get { return stringValue; } set { stringValue = value; } } } Service.cs public class Service : IService { public string GetData(int value) { string value2 = Convert.ToString(value); return value2; } }How do I get data?
Thanks for the answers
2 Answers
Your service seems to return an (error) html page. You need to make your reply a json to use it with the code you provided.
I'm sure you've figured this out by now, but you need to call your service like this:
"http://www.viernesnegro.cr/Service.svc/GetData/{value}"
Where {value} is the id of the record you want returned.
Your Answer
Think you can help? Login to answer this question!