I need to pass a simple Javascript array to my wcf ajax webservice:
var array = new Array();
array["ParamA"] = "xyz";
array["12344"] = "9";
myNamespace.DoSomething(array);
This this my WCF method:
[OperationContract]
[WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
public void DoSomething(object values)
"values" is an empty array when it is called from javascript with my values. What is the best approach to pass a simple list of KeyValuePairs to my webservice?
See Question&Answers more detail:os