WCF/WF - can anyone consume this service? - Asked By balaji on 06-Mar-13 07:18 AM

This is my service. Any other better way to design this? can any one consume this service i.e. javascript,php, Java.
or should i go for WCF RESTful service (don't know exactly)?
Interface

[ServiceContract]
public interface IService1
{
    [OperationContract]
    datas GetData(input ip);    
}
[CollectionDataContract]
public class datas : List<output>
{
    public datas() { }
    public datas(List<output> datas) : base(datas) { }
}
[DataContract]
public class output
{
    [DataMember]
    public string city
    {
      get;
      set;
    }    
}
[DataContract]
public class input
{
[DataMember]
    public string id
    {
      get;
      set;
    }   
}

service implementation

public class Service1 : IService1
{
    public datas  GetData(input ip)
    {        
       datas collection = new datas();                 
       tbTemp = con.GetDataTable(query);              
       foreach (DataRow dtRow in tbTemp.Rows)
       {
         output op = new output();
         op.city = dtRow[0].ToString();          
         collection.Add(op);
       }         
       return collection;       
    }    
}

Robbe Morris replied to balaji on 06-Mar-13 08:51 AM
Depended on how you are wiring up your settings in the web.config.  You'd want one for JSON for JavaScript clients and probably one for SOAP for PHP and Java.