Menu
  • HOME
  • TAGS

WCF WebInvoke POST message body

c#,wcf,post,webinvoke

First you need to change your service contract like this: [OperationContract] [WebInvoke(UriTemplate = "EchoWithPost", Method = "POST")] string EchoWithPost(string s); Notice how the UriTemplate is no longer expecting any variable value in the URL. To invoke such an operation from a client: // Set up request string postData = @"""Hello...