C# “错误”;无效的JSON原语“;反序列化时?

C# “错误”;无效的JSON原语“;反序列化时?,c#,asp.net,.net,C#,Asp.net,.net,我正在序列化对象,使其从WebAPI返回 下面的代码从DB获取数据并序列化对象: public string GetHealthInsuranceApplication(int PId) { HealthApplicationViewModel model = new HealthApplicationViewModel(); model.ProductDetails.Category = StringResources.ProductCategory

我正在序列化对象,使其从
WebAPI
返回

下面的代码从DB获取数据并序列化对象:

public string GetHealthInsuranceApplication(int PId)
    {  
        HealthApplicationViewModel model = new HealthApplicationViewModel();
        model.ProductDetails.Category = StringResources.ProductCategoryFamily;
        model.Tab = HealthLeadTab.YourDetails;
        model.ProductDetails = db.CurrentProductSetRepository.GetByID(PId);
        string data = new JavaScriptSerializer().Serialize(model);                
        return data;                   
    }          
}
以下是我的序列化字符串:

{“应用程序”:{“LeadSequence”:0,“SessionID”:null,“ProductId”:null,“Button1”:null,“Button2”:null,“LeadID”:null,“Fname”:null,“Lname”:null,“Email”:null},“HealthProductDetails”:{“LeadSequence”:0,“SessionID”:null,“Pid”:null,“ProductName”:null,“Cost”:null,“多余”:null,“StartText”:null,“StartDate”:null,“FederalRebate”:null,“MedicarDNO”:null,“MedicareCardName”:null,“MedicareBenefitsEligible”:null,“TransformAnotherFund”:null,“ExistingFundName”:null,“ExistingMembershipNo”:null,“PartnerFundName”:null,“Insertedon”:null,“Modifiedon”:null,“RolloverStartDate”:null,“RolloverPartnerStartDate”:null,“RolloverPartnerQuestion”:null,“MedicareCardExpiryDate”:null,“IncomeTier”:null,“Clientid”:null},“AppliantDetails”:{“LeadSequence”:0,“Title”:null,“GivenName”:null,“姓氏”:null,“DOB”:null,“性别”:“Address1”:null,“Address2”:null,“郊区”:null,“州”:null,“Postcode”:null,“IsPoststal”:null,“PostalAddress1”:null,“PostalAddress2”:null,“Postalsuburb”:null,“PostalState”:nullPostalCode:null,“WorkPhone:null”,HomePhone:null,“Mobile:null”,Email:null,“ContinuousCover:null”,PartnerTitle:null,“PartnerName:null”,PartnerLastName:null,“PartnerDOB:null”,PartnerGender:null,“PartnerContinuousCover:null”,Conditions:null,“Insertedon:null”,Modifiedon:null},“DependentDetails”:[],“PaymentDetails”:{”LeadSequence“:0,“PaymentMethod”:null,“Frequency”:null,“Day”:null,“CardType”:null,“CardNo”:null,“CardName”:null,“ExpireyYear”:null,“BSB”:null,“AccountNo”:null,“AccountName”:null,“FinancialInstitution”:null,“Branch”:null,“Authority”:false,“Insertedon”:“\/Date(-62135596800000)\/”,“Modification:“\/Date(-62135596800000)\/”,“修改”:“,”状态:null,“ClaimBSB”:null,“ClaimAccountNo”:null,“ClaimAccountName”:null,“CardCCV”:null,“Processed_FundID”:null,“Processed_FundName”:null,“Processed_ProductName”:null,“Processed_Category”:null,“Processed_Premium”:0,“Processed_ProductType”:null,“PolicyNumber”:null,“ClaimFinancialInstitution”:null,“Salefom”:null,“MaskedCCNumber”:null,“TempCRN”“:null}”,LeadDetails:{“Lid”:0,“LeadId”:null,“Lifestage”:null,“Age”:null,“State”:null,“IpAddress”:null,“Filter\u Hospital\u救护车”:null,“Filter\u Hospital\u assistedredreproductive”:false,“Filter\u Hospital\u产科”:false,“Filter\u Hospital\u cardiac”:false,“Filter\u Hospital\u白内障”:false,“Filter\u Hospital\u renalFailure”,“Filter\u Hospital\u Jointreplacements sall”:false,“Filter\u Hospital\u Plastics”non-cosmetic:false,“Filter\u Hospital\u绝育”:false,“Filter\u Hospital\u PalimativeCare”:null,“Filter\u Hospital\u Non-medicare”:null,“Filter\u DentalGeneral”:false,“Filter\u dentalMajor”:false,“Filter\u dentalDodontic”:false,“Filter\u dentalOrthontal”牙齿正畸:false,“Filter\u optical”:false,“Filter\u physical therapy”:null,“Filter\u脊骨疗法”:false,“Filter\u足病学”:false,“Filter\u psychology”:false,“Filter\u针灸”:false,“Filter\u naturophy”:false,“Filter\u按摩”:false,“Filter\u Hearingaids”:false,“Filter\u血液葡萄糖监测器”:false,“Filter\u救护车”:false,“EntryTime”:“/日期”(1416364323531)\/“,“情况”:null,“获取特别基金”:null,“账户共享”:false,“账户共享”:false,“账户公共”:false,“过滤医院”康复:false,“过滤医院”精神病学:false,“HMC医院”:null,“HMC医院”:null,“HMC额外费用”:null,“订阅”:null,“回扣百分比”:null,“lhc总百分比”:null,“lhc p1百分比”:null,“lhc p2百分比”:null,“付款频率”:“月份”,“超额”选项:null,“选定的资金”:null,“筛选医院”GastricBanding:false,“筛选医院”GastricBanding:false,“筛选医院”GastricBanding:null,“ShowPopUpOnLoad:false,”PaymentFrequencyText:“每月”,“ResultsForText:“一年的结果,.”“},“产品详细信息”:{“PID”:1,“产品密钥”:1160,“产品ID”:“0cfc44eb-5d7f-471a-af71-d25f4355d525”,“HMCProductExtraID”:null,“FundID”:“06e94e02-c6e3-4d3c-8c34-940f590f8238”,“FundName”:“CUA Health Limited”,“产品名称”:“Silver Extras”,“产品URL”:”http://www.cuahealth.com.au“,”表格代码“:”I2“,”州“:”NT“,”类别“:”单亲家庭“,”产品类型“:”一般健康“,”高级“:”84.98,“高级医院”:null,“DateValidFrom”:“\/Date(1396270800000)\/”,“MedicalRelevySourceExempt”:“False”,“ClassificationGeneralHealth”:“Medium”,“OtherProductFeatures”:“CUA Health\u0027s附加服务政策为大量服务提供了物有所值的服务,并提供现场索赔。所有CUA Health客户都可以从领先的光学零售店获得额外折扣。有关更多详细信息,请访问www.cuahealth.com.au”,“封面”:“完整”,“福利集团”:“救护车”,“GapCoverProvided”:null,“分类医院”“:null,“住宿”:null,“医院救护车”:null,“医院救护车”:null,“医院救护车”:false,“一般帮助覆盖键”:1161,“过滤牙科医生”:true,“过滤足部学”:true,“过滤按摩”:true,“过滤自然疗法”:true,“过滤救护车”:false,“过滤脊骨疗法”:true,“过滤针灸术”:true,“过滤牙髓疗法”:true,“滤过器听力助手”:真,“滤过器葡萄糖监测仪”:真,“滤过器物理疗法”:真,“滤过器心理学”:真,“滤过器非BS”:真,“滤过器光学”:真,“滤过器正畸”:真,“滤过器医院心脏”:假,“滤过器医院心脏”限制:假,“滤过医院精神病”:假,“滤过医院精神病”限制:假过滤医院消毒:false,“过滤医院消毒”限制:false,“过滤医院消毒”限制:false,“过滤医院消毒”限制:false,“过滤医院消毒”限制:false,“过滤医院消毒”非渗透:false,“过滤医院消毒”非渗透:false,“过滤医院消毒”非渗透:false,“过滤医院消毒”非渗透:false,“过滤医院消毒”产科:false,“过滤医院非产科:false,“过滤医院非医疗”:false,“过滤医院非医疗”:false,“过滤医院非医疗”:false,“过滤医院助理产品”
 public static T GetObjectFromSerializedJSONString<T>(string data)
         where T : class, new()
    {
        T obj = new T();

        if (!string.IsNullOrEmpty(data) && data !="null")
        {
            JavaScriptSerializer jsSerObj1 = new JavaScriptSerializer();
            jsSerObj1.MaxJsonLength=int.MaxValue;
            data =jsSerObj1.Deserialize<string>(data);
            JavaScriptSerializer jsSerObj2 = new JavaScriptSerializer();
            jsSerObj2.MaxJsonLength = int.MaxValue;
            obj =jsSerObj2.Deserialize<T>(data);
        }            

        return obj;
    }
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">