When I create a new WCF service, I can create a new method like this one:
[OperationContract]
[WebInvoke(Method = \"GET\", UriTemplate = \"TryThis\", Resp
It seems that you host the WCF service in IIS, and you want to publish a Restful-style service, you could refer to the following code.
Server:IService.cs
namespace WcfService5
{
[ServiceContract]
public interface IService1
{
[OperationContract]
[WebGet]
string GetData(int value);
}
}
Server:Service.svc.cs
namespace WcfService5
{
public class Service1 : IService1
{
public string GetData(int value)
{
return string.Format("You entered: {0}", value);
}
}
}
Web.config.
Result.
Feel free to let me know if there is anything I can help with.