title: How to deserialize JSON returned by WCF Data Service (OData)
body: <p>An external OData Service returns the following during a POST operation (for a service operation):</p>
  
  <pre><code>{
  "d" : {
  "__metadata": {
  "uri": "http://dd-1620/ServiceData.svc/Customers('1001')", "type": "DataModel.Customer"
  }, "MasterCustomerId": "1001", "SubCustomerId": "0", "FirstName": "Jag", "LastName": "Chat"
  }
  }   
  </code></pre>
  
  <p>I wrote the following to deserialize the above:</p>
  
  <pre><code>HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
  Stream respStream = resp.GetResponseStream();
  DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(ReturnType));
  ReturnType oRespCus = (ReturnType)ser.ReadObject(respStream);
  </code></pre>
  
  <p>Now, oRespCus is indeed instantiated.  However, with all fields set to null.</p>
  
  <p>Can anyone help me on this.</p>
  
  <p>thanks</p>