title: JSON object posted null in wcf rest
body: <p>I am new to android and I have a simple android app that gather information and save to db.I want to save this information in my sql server in my host.I post the info in aSync task as this :</p>
  
       
  
  <pre class="lang-java prettyprint-override"><code>          @Override
         protected JSONObject doInBackground(String... arg0) {
      // TODO Auto-generated method stub
      // POST request to &lt;service&gt;/SaveVehicle
      HttpPost request = new HttpPost(url);
      request.setHeader("Accept", "application/json");
      request.setHeader("Content-type", "application/json");
  
      // Build JSON string
      StringEntity entity;
      try {
          //Gson gson=new Gson();
          //String jstr = gson.toJson(jsonObjSend);
          //Log.d("json", jstr);
          entity = new StringEntity(jsonObjSend.toString(),"UTF-8");
          entity.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
          entity.setContentType("application/json");
  
          //InputStream content = entity.getContent();
  
          request.setEntity(entity);
      } catch (UnsupportedEncodingException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } 
  
  
  
      // Send request to WCF service
      DefaultHttpClient httpClient = new DefaultHttpClient();
      HttpResponse response;
      try {
          response = httpClient.execute(request);
          Log.d("WebInvoke", "Saving : " +     response.getStatusLine().getStatusCode());
      } catch (ClientProtocolException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
  
      return null;
  }
  </code></pre>
  
  <p>My wcf Iservice looks like this :
  </p>
  
  <pre class="lang-java prettyprint-override"><code>        [WebInvoke(
          Method = "POST",
          BodyStyle = WebMessageBodyStyle.Wrapped,
          RequestFormat = WebMessageFormat.Json,
          ResponseFormat = WebMessageFormat.Json,
          UriTemplate = "CustInfo")]
      [OperationContract]
      ResponseCustInfo CustInfo(RequestCustInfo CustInfo);
  
  
  [Serializable, DataContract(Name = "CustInfo")]
  public class RequestCustInfo
  {
  
  
      [DataMember(Name = "StoreName")]
      public string StoreName
      {
          get;
          set;
      }
  
      [DataMember(Name="City")]
      public string City
      {
          get;
          set;
      }
  
      [DataMember(Name = "brands")]
      public List&lt;RequestCustBrands&gt; brands
      {
          get;
          set;
      }
  
   }
      //service :
      public ResponseCustInfo CustInfo(RequestCustInfo CustInfo)
      {
          ResponseCustInfo res = new ResponseCustInfo();
          try
          {
              Android.Sync.CustInfo CustDeserializedObj = new Android.Sync.CustInfo();
              if (CustInfo != null)
              {
                 CustDeserializedObj.StoreName = CustInfo.StoreName;
                 CustDeserializedObj.City = CustInfo.City;
                 CustDeserializedObj.brands = CustInfo.brands;
              }
              //save object to sql...
  </code></pre>
  
  <p>AND my json string is like this :</p>
  
  <pre class="lang-java prettyprint-override"><code>{"CustInfo":[{"StoreName":"test","City":"تهران"},[{"CustomerRef":"25","BrandRef":"272","GoodsRef":"21"},{"CustomerRef":"25","BrandRef":"272","GoodsRef":"21"}]]}
  </code></pre>
  
  <p>My problem is when I debug the service the "CustInfo" object is null.</p>
  
  <p>I appreciate your help in advance.</p>