. , ".". . , :
[OperationContract]
[WebGet(UriTemplate = "category/{id}")]
string category(string id);
url http://localhost/MyService.svc/category/test.category ` "test.category" .
, - . URL-? ? javascript-? , . . URL- , , , URL- , .
, WCF 3.5 SP1 WCF 3.5? RESTFul.Net , , UriTemplate.
, , RESTFul.Net, , .
class Program
{
static void Main(string[] args)
{
var binding = new WebHttpBinding();
var sh = new WebServiceHost(typeof(TestService));
sh.AddServiceEndpoint(typeof(TestService),
binding,
"http://localhost:8889/TestHttp");
sh.Open();
Console.WriteLine("Simple HTTP Service Listening");
Console.WriteLine("Press enter to stop service");
Console.ReadLine();
}
}
[ServiceContract]
public class TestService
{
[OperationContract]
[WebGet(UriTemplate = "category/{id}")]
public string category(string id)
{
return "got '" + id + "'";
}
}