I am currently facing an issue with the configurations on my asmx page. The code is set up like this:
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;
using System.Web.Services;
using Time.CSharpclasses;
/// <summary>
/// Summary description for LiquidityMonthAjax
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class LiquidityMonthAjax : System.Web.Services.WebService
However, when I receive a response on the client side, the data seems to be in a format that I have never encountered before, despite using the same JSON parsing methods.
#document
<string xmlns="tempuri.org">
["Presbyterian Health","Devon","LABS","Self-Pay","Sagamore"]
</string>
This unexpected change has me puzzled. Normally, I retrieve my JSON data from .d.
Using Asp 4
I suspect there might be a missing dependency issue, but I'm not sure if it's on the client-side or server-side.
[WebMethod]
public string getUniqueFinClass()
{
DataTable dt = ExcelManager.CreateDataTableFromSql(new XMLManager("liquiditymonth.xml").getReport(Xmls[6]));
var r = from row in dt.AsEnumerable() select (string)row["FinancialClass"];
return DictToJSON.serializeJSONObject(r.ToList());
}
The problem seems to lie within the serializeJSONObject method which looks like this:
public static String serializeJSONObject(Object items)
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new
System.Web.Script.Serialization.JavaScriptSerializer();
serializer.MaxJsonLength = 2147483644;
return serializer.Serialize(items);
}
Despite having successfully used this method many times before, I can't pinpoint why it's causing issues now.