Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 100001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:29:44+00:00 2026-05-11T00:29:44+00:00

I’m trying to solve the problem of passing a 2-dimensional table into JavaScript AJAX

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:29:45+00:00Added an answer on May 11, 2026 at 12:29 am

    Building on sktrdie‘s answer, You could use ASP.NET AJAX JSON Web Services to pass and return the data as JSON objects. Here are some examples-

    • Using ASP.NET AJAX 3.5 JSON Web Services
    • Using JSON Syntax with ASP.NET AJAX
    • Understanding ASP.NET AJAX Web Service Proxies

    There is a lot of good information on JSON in this question – What is JSON and why would I use it?

    EDIT –

    At the moment, you say that you are using SOAP, which is an XML-based transport protocol. There is a very succinct article here – Extending an existing ASP.NET Web Service to support JSON – that explains how to extend an existing web service,

    In addition, if you do not have access to .NET 3.5 JSON serializer/deserializer, have a look at James Newton King’s JSON.NET library.

    EDIT 2 –

    Looking at your screenshot again and the fact that you have the [ScriptService] attribute, you appear to be returning a JSON string (which I understand is the default). Therefore, I’m thinking is the ASP.NET AJAX JSON serializer failing to serialize the nullable double in this line

    public Dictionary<string, Dictionary<string, double?>> EmployeePaycodeRate; 

    to the correct JSON data type in each instance? You could see whether this is the case by changing the web service to return a double, and then try it with data that have values.

    According to MSDN–

    Nullable types are also supported and map to JSON in the same way as non-nullable types.

    Nonetheless, I think it’s worth looking at in a similar manner to as I have suggested, as this is where your problem is occurring

    Hope this helps

    EDIT 3 –

    It seems strange why a Dictionary with a Dictionary value would not be possible to represent in a JSON string. Consider that a Dictionary looks like this in JSON

    [{'Key':'a1','Value':'a1'}, {'Key':'a2','Value':'a2'}] 

    A Dictionary with a Dictionary value would therefore look like so (I believe)

    [{'Key':'a1','Value': {'Key':'b1','Value':'b1'} }, {'Key':'a2','Value': {'Key':'b2','Value':'b2'} }] 

    which is valid JSON according to JSONLint – the JSON validator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Does anyone know how can I replace this 2 symbol below from the string
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.