title: How to pass parameter(s) to a WCF post method (a restful services)
body: <p>I am working on a WCF rest based services. I have written Get and Post methods in my service and Get methods are able to working (fetching data) when I typed in URL (in JSON format.</p>
  
  <p>Problem is when I try to do the same for POST methods, the url was navigating to some other page "Page not found...".</p>
  
  <p>I understood that a POST method requires a form submission to process the request.</p>
  
  <p>For that the reason, I have tried chrome extensions (Simple Rest client, Advanced Rest client,  Post man rest client) and Fiddler also.</p>
  
  <p>Here I am posting my service method - Get method (interface method declaration).</p>
  
  <pre><code>[OperationContract]
  [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, 
  ResponseFormat =   WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, 
  UriTemplate = "GetCategoryTypes/")]
  List&lt;CategoryType&gt; GetCategoryTypes();
  </code></pre>
  
  <p>and this is my POST method</p>
  
  <pre><code>[OperationContract]
  [WebInvoke(Method = "POST", UriTemplate = "AddOrders/", 
  RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json,
  BodyStyle = WebMessageBodyStyle.WrappedRequest)]
  int AddOrders(decimal amount, int tableID, DateTime orderDate, int isActive);
  </code></pre>
  
  <p>Here is my web.config file for the service.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0" /&gt;
     &lt;/system.web&gt;  
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="ServiceBehaviour" allowCookies="true" messageEncoding="Mtom" /&gt;
        &lt;/basicHttpBinding&gt;
        &lt;webHttpBinding&gt;
          &lt;binding name="ServiceBehaviour1" allowCookies="true"/&gt;
        &lt;/webHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service name="EMC.DD.ServiceLayer.Service1" ehaviorConfiguration="ServiceBehaviour"&gt;
          &lt;endpoint address="http://localhost/EMCService/Service1.svc" 
             binding="basicHttpBinding" contract="EMC.DD.ServiceLayer.IService1"&gt;
            &lt;identity&gt;
              &lt;dns value="localhost" /&gt;
            &lt;/identity&gt;
          &lt;/endpoint&gt;      
        &lt;/service&gt;
        &lt;service name="EMC.DD.ServiceLayer.Service2" 
           behaviorConfiguration="ServiceBehaviour1"&gt;
          &lt;endpoint address="http://localhost/EMCService/Service2.svc" 
            binding="webHttpBinding" behaviorConfiguration ="web" 
            contract="EMC.DD.ServiceLayer.IService2"&gt;
            &lt;identity&gt;
              &lt;dns value="localhost" /&gt;
            &lt;/identity&gt;
          &lt;/endpoint&gt;     
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name ="ServiceBehaviour"&gt;     
            &lt;serviceMetadata httpGetEnabled="true" /&gt;      
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
          &lt;behavior name ="ServiceBehaviour1"&gt;       
            &lt;serviceMetadata httpGetEnabled="true" /&gt;        
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
        &lt;endpointBehaviors&gt;
          &lt;behavior name ="web"&gt;
            &lt;webHttp/&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
      &lt;/behaviors&gt; 
    &lt;/system.serviceModel&gt;
   &lt;system.webServer&gt;
          &lt;directoryBrowse enabled="true" /&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I am not really sure whether there is any mistake in my method constructing (POST method) or else the way I need to test it.</p>
  
  <p>I need an help from all of your experts and I am fighting with this issue for the past 2 days and atlast I came here to post it.</p>
  
  <p>Any help highly appreciated.</p>