I'm trying to solve the problem of passing a 2-dimensional table into JavaScript AJAX application through SOAP web services. I'm trying to pass data into JavaScript web page through ASP.NET web service declared with following attributes:
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
I need a complex type to be passed into the JavaScript:
[Serializable]
public class PayRateSummary
{
public string[] EmployeeId;
public Dictionary<string, string> EmployeeName;
public string[] PaycodeId;
public Dictionary<string, Dictionary<string, double?>> EmployeePaycodeRate;
}
[WebMethod(EnableSession = true)]
public DataElements.PayRateSummary EnumPayRates(Guid companyId)
{
}
And web service declared in a pretty standard way:
<asp:ScriptManager runat="server" ID="ScriptManager1">
<Services><asp:ServiceReference Path="~/WebService.asmx" /></Services>
</asp:ScriptManager>
... function RefreshPayRates() { WebService.EnumPayRates(CompanyCurrent, OnPayRatesLoaded, OnFailure); }
For some reason, Dictionary[string,string] is getting passed allright, but not the Dictionary[string,Dictionary[string,string]]:
--> http://vvcap.net/db/8rveoL-FMP6EUikCaqiz.htp
I remember beating my head against the wall in the past to understand, what could be done to pass such objects and never found any solution.