title: Pass a javascript map to json wcf service
body: <p>I would like to pass an associative array to a json wcf service.</p>
  
  <p>So in JavaScript I have something akin to this:</p>
  
  <pre><code>var map = { };
  map['a'] = 1;
  map['b'] = 2;
  map['c'] = 3;
  </code></pre>
  
  <p>And in my wcf service I want to expect a Dictionary:</p>
  
  <pre><code>[OperationContract][WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
  public void setDictionary(Dictionary&lt;string, int&gt; myDictionary);
  </code></pre>
  
  <p>But it sends the map as an [Object object] rather than serializing it because the 'map' is actually just an object I'm assigning properties to.</p>
  
  <p>Does anyone know how I can serialize it to correctly to get it deserialized as a Dictionary object by the WCF service?</p>