POST JSON array to ASP.NET WebMethod
<p>I have a script which returns a data array in JSON as per below.</p>

<pre><code>[
    {"ItemID":"10319","ItemCode":"ITEM-010318","Qty":"1","custRef":"12 - Mitsubishi Fighter FK61F"},
    {"ItemID":"10933","ItemCode":"ITEM-010932","Qty":"1","custRef":"12 - Mitsubishi Fighter FK61F"},{"ItemID":"10537","ItemCode":"ITEM-010536","Qty":"1","custRef":"12 - Mitsubishi Fighter FK61F"},
    {"ItemID":"14863","ItemCode":"ITEM-014862","Qty":"1","custRef":"12 - Mitsubishi Fighter FK61F"},
    {"ItemID":"14864","ItemCode":"ITEM-014863","Qty":"1","custRef":"12 - Mitsubishi Fighter FK61F"}
]
</code></pre>

<p>This data is stored in a variable called <code>cartData</code></p>

<p>I then push the data to my WebMethod via AJAX, as follows</p>

<pre><code>$.ajax({
    type: "POST",
    contentType: "application/json; charset=utf-8",
    url: "OrderFormServices.asmx/AddItemsToCart",
    data: JSON.stringify(cartData),
    dataType: "json"

});
</code></pre>

<p>My web method looks like this</p>

<pre><code>[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public void AddItemsToCart(string [] itemID, string [] itemCode, string [] Qty, string [] custRef)
</code></pre>

<p>However when I try and POST the data, I get an error on the console which I can't make head or tail of! Can anyone shed some light on it?</p>

<pre><code>Type 'System.Collections.Generic.IDictionary`2[[System.String, mscorlib, Version=4.0.0.0, 
Culture=neutral, PublicKeyToken=b77a5c561934e089],
[System.Object, mscorlib, 
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'
is not supported for deserialization of an array.
</code></pre>