Hello,
I have a web service that uses WCF. This web service has a single method that I want to be accessible from two different types of clients. The first type of client is a Silverlight application. The second type of client is a AJAX application that relies on JQuery. Is it possible to write the method once such that both types of clients can access the web service? If so, how? Here is my code thus far:
[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class myService
{
[OperationContract]
public List<string> SearchByName(string name)
{
List<string> results = new List<string>();
results.Add("Bill");
results.Add("John");
// more retrieved through database hit.
return results;
}
}
Thank you!