1
votes

I have a wcf service, which I made restfull, but editing the intereface and the webconfig. In the interface, I have the following:

[ServiceContract]
public interface ITsmApi
{
    [OperationContract] 
    [WebInvoke(UriTemplate = "/GetOrganizationNo", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml, Method = "POST")]
    string GetOrganizationNo(CustomerNoInput input);
}

I would like if it is possible that I call the webservice function in this manner:

http://foo.example/api/v1/accounts/3

I would like that my URL link to the functions don't look like this:

http://servername.com/MyApi/MyApi.svc/AddPerson - meaning I would like to not have the SVC extension. Is that possible at all?

I have suspicion that I have to use service contract namespace, but I can't find what the procedure is?