Sunday, 15 June 2014

Using same UriTemplate attribute for POST and GET operations WCF REST C# -



Using same UriTemplate attribute for POST and GET operations WCF REST C# -

i getting "method not allowed." error wcf service when invoking operation. know why happening can't understand why not allowed. guess might doing wrong. trying utilize same uritemplate (attribute) construction , post. next standard rest service convention:

get - /api/v1/{entitytype} - list of {entitytype} e.g. /api/v1/cars post - /api/v1/{entitytype} - insert entity e.g /api/v1/car class="lang-cs prettyprint-override">[operationcontract] [webget(bodystyle = webmessagebodystyle.bare, responseformat = webmessageformat.json, uritemplate = "api/v1/{entitytype}?skip={skip}&take={take}")] list<entity> getentitylist(string entitytype, int skip, int take); [operationcontract] [webinvoke(method = "post", bodystyle = webmessagebodystyle.bare, responseformat = webmessageformat.json, requestformat = webmessageformat.json, uritemplate = "api/v1/{entitytype}")] entity insertentity(string entitytype, entity entity);

i understand uritemplates same why not allowed? doesn't server observe operation trying perform?

wcf rest post .net-3.5 get

No comments:

Post a Comment