Hi James. Appreciate some help to resolve this one.
I have following contract defined at my endpoint which needs POST, another GET method works fine.
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = " m=Register&username={username}&password={password}&token={token}")]
void Register(string username, string password, string token);
I can create the following test html page.
<html>
<form action="http://dev/services/api/my.Registration/default.svc" method="post">
<input type=text name="m" value="Register" />
<br/>
<input type=text name="username" value="test"/>
<br/>
<input type=text name="password" value="test" />
<br/>
<input type=text name="token" value="test" />
<br/>
<input type=submit />
</form>
</html>
I get the following in my IIS log.
09:58:27 192.168.7.3 GET /services/api/my.Registration/default.svc 307
09:58:27 192.168.7.3 GET /services/api/my.Registration/default.svc 405
09:59:24 192.168.7.3 POST /services/api/my.Registration/default.svc 404
As you can see I make the GET query successfully, but the POST to the same page fails - not even with a 405, but a 404 ! You rightly point out this could be something i am doing that is not mapping the template... i have tried quite a few variations with no success. Any help here would be very much appreciated.
Unfortunately the samples don't deal with interop of REST services so i don't know whether i am doing something wrong or whether there is some problem and hence no sample.
Regards,
Steven
http://dev/services/api/my.Registration/default.svc" method="post">
<input type=text name="m" value="Register" />
<br/>
<input type=text name="username" value="test"/>
<br/>
<input type=text name="password" value="test" />
<br/>
<input type=text name="token" value="test" />
<br/>
<input type=submit />
</form>
</html>
I get the following in my IIS log.
09:58:27 192.168.7.3 GET /services/api/my.Registration/default.svc 307
09:58:27 192.168.7.3 GET /services/api/my.Registration/default.svc 405
09:59:24 192.168.7.3 POST /services/api/my.Registration/default.svc 404
As you can see I make the GET query successfully, but the POST to the same page fails - not even with a 405, but a 404 ! You rightly point out this could be something i am doing that is not mapping the template... i have tried quite a few variations with no success. Any help here would be very much appreciated.
Unfortunately the samples don't deal with interop of REST services so i don't know whether i am doing something wrong or whether there is some problem and hence no sample.
Regards,
Steven
http://livz.org