Getting the value of UriTemplate of WebInvoke without using method parameter

  • Thread starter Thread starter TinaAnas
  • Start date Start date
T

TinaAnas

Guest
Hi,

I have the following WCF service contract:

[ServiceContract]
public interface ICommandService
{
[OperationContract]
[WebInvoke(Method = "POST",
UriTemplate = "/JSON/{action}",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped)]
void Execute(string action, string json);
}

The problem is that when I call the WCF operation I need to wrap the json inside another json; like this

ecmscommandservice.svc/JSON/DeletePatient
{
"action":"DeletePatient",
"json": "{\"Id\":5}"
}

Can I remove the parameter of action and still got its value inside my method body?

Thanks,

Continue reading...
 
Back
Top