title: WCF WebInvoke Method POST
body: <p>I have a wcf service, and I want to test posting data to it. But the parameter of my function never gets any values.</p>
  
  <pre><code>[OperationContract]
  [WebInvoke(UriTemplate = "TestPost", Method = "POST", 
          ResponseFormat = WebMessageFormat.Json,
          RequestFormat = WebMessageFormat.Json,
          BodyStyle = WebMessageBodyStyle.WrappedRequest)]
  int Test(string value);
  
  public int Test(string value)  //Value stays null
  {
      return 0;
  }
  </code></pre>
  
  <p>The JSON request I send, build using Fiddler2</p>
  
  <pre><code>http://localhost:49633/Service1.svc/TestPost
  
  User-Agent: Fiddler
  Host: localhost:49633
  Content-Length: 42
  Content-type: application/json
  
  {"value":{"name":"value","name1":"value"}}
  </code></pre>
  
  <p>I want the parameter to contain a JSON string, so basically I am creating a JSON request that contains a JSON object, because I want to deserialize the JSON object later on into one of my custom objects. Any ideas why the value parameter stays null?</p>
  
  <p>Thanks</p>