forum.venkateswarlu.net
      Register      Login
wcf RESTful api

No replies to this topic

Gaurav Dutt #1
Member
62 Points
Posted on 10 Jan 2012 08:32 AM IST hi,
I am working RESTful api and i create a service as service1.svc.
I create a operation contract as:
Iservice1.cs
[OperationContract]
[WebInvoke(UriTemplate ="dowork", Method="POST",
BodyStyle = WebMessageBodyStyle.Wrapped)]
void PostSampleMethod();

service1.cs
public void dowork()
{
string str1 = "DELHI";

}

when i run my service like: http://app.abc.com/service1.svc/dowork

I got: Method not allowed.
same, will work fine with Method="GET". Problem occurred with Method="POST"
I am using iis 7.5 and i also provide verbs as GET,POST in Handler Mapping.

Now, what should i do. Please help me out.
Thanks.  
WCF     981 views     Reply to this topic