title: Sending array as parameters using POST method in senchatouch2
body: <p>Using this service i want to store array value into database using POST method in senchatouch2..Service is written in (WCF)</p>
  <p><strong>Service declaration :</strong></p>
  <pre><code>[OperationContract]
  [WebInvoke(Method = &quot;POST&quot;, 
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             BodyStyle = WebMessageBodyStyle.Wrapped,
             UriTemplate = &quot;/Check1&quot;)]
  int Psngr(string[] FirstName);
  </code></pre>
  <p><strong>Service definition :</strong></p>
  <pre><code>public static int Psngr(string[] FirstName)
  {  
      List&lt;Psgr&gt; psgr = new List&lt;Psgr&gt;();
      var getVal = from s in FirstName select s;
      int count = getVal.Count();
  
      SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings[&quot;db&quot;].ToString());
      con.Open();
  
      using (var cmd = new SqlCommand(&quot;SP_InsertCheck1&quot;, con))
      {
          int result;
          cmd.CommandType = CommandType.StoredProcedure;
  
          for (int i = 0; i &lt; count; i++)
          {
              cmd.Parameters.Clear();
              cmd.Parameters.AddWithValue(&quot;@FirstName&quot;, FirstName[i]);
  
              using (var Da = new SqlDataAdapter(cmd))
              using (var Ds = new DataSet())
              {
                  Da.Fill(Ds);
                  result = Convert.ToInt16(Ds.Tables[0].Rows[0][&quot;Result&quot;].ToString());
              }
          }
          return 1;
      }
  }
  </code></pre>
  <p>I accesssed this service through my ajax request as follows:</p>
  <pre><code>Ext.Ajax.request({
      url:'http://ws.easy4booking.com/E4b.svc/Check1',                                                   
      method:'POST',                                            
      disableCaching: false,                                          
      headers: {
         'Accept': 'application/json',
         'Content-Type': 'application/json'
      },
      params: {
          FirstName:fname_toString,  //FirstName:[&quot;Sam&quot;,&quot;Paul&quot;],
  },
      success:function(response) {
          console.log(response);
      }
  });
  </code></pre>
  <p>When I accessed this service lik mentioned above i got following error</p>
  <p><strong>Request Error:</strong></p>
  <blockquote>
  <p>The server encountered an error processing the request. The exception message is 'The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'Psngr'. Encountered unexpected character 'F'.'. See server logs for more details. The exception stack trace is:</p>
  <p>at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters) at
  System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters) at
  System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters) at
  System.ServiceModel.Dispatcher.CompositeDispatchFormatter.DeserializeRequest(Message message, Object[] parameters) at
  System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc) at
  System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc) at
  System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc) at
  System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&amp; rpc) at
  System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc) at
  System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc) at
  System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc) at
  System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc) at
  System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc) at
  System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean
  isOperationContextSet)</p>
  </blockquote>