无法将null转换为从Base64解码的值类型JSON Web响应

时间:2016-12-07 03:47:29

标签: c# json json-deserialization

作为Web响应的一部分,我返回了一个Base64编码的JSON字符串。一旦我像这样解码它,我试图反序列化它。

string rptJsonContent = Encoding.UTF8.GetString(Convert.FromBase64String(atch.content));

完整的响应很长,但我继续得到一个无法将null转换为值类型错误。

我已将以下类声明为从json2csharp.com转换而来

    public class Salary
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class Benefit
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}


public class OtherIncome
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class Income
{
    public List<Salary> Salary { get; set; }
    public List<Benefit> Benefits { get; set; }
    public List<OtherIncome> OtherIncome { get; set; }
}

public class SmallAmountLoan
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class SmallAmountRepayment
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class OtherLoan
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class OtherRepayment
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class Loans
{
    public List<SmallAmountLoan> SmallAmountLoans { get; set; }
    public List<SmallAmountRepayment> SmallAmountRepayments { get; set; }
    public List<OtherLoan> OtherLoans { get; set; }
    public List<OtherRepayment> OtherRepayments { get; set; }
}

public class Dishonour
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class Dishonours
{
    public List<Dishonour> DishonoursPmt { get; set; }
}

public class HighRiskMerchant
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class HighRiskMerchants
{
    public List<HighRiskMerchant> HighRiskMerchantEntity { get; set; }
}

public class Rent
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class Periodic
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class NonPeriodic
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class TopUncommittedSpend
{
    public int AccountID { get; set; }
    public string H1 { get; set; }
    public string H2 { get; set; }
    public string H3 { get; set; }
    public string SH1 { get; set; }
    public string Description { get; set; }
    public int? Count { get; set; }
    public string FrequencyDescription { get; set; }
    public string FrequencyDuration { get; set; }
    public string FrequencyDurationDate { get; set; }
    public string FrequencyWeekday { get; set; }
    public double? FrequencyAmount { get; set; }
    public string FrequencyAmountRange { get; set; }
    public double? TotalAmount { get; set; }
    public double? TotalInAmount { get; set; }
    public double? TotalOutAmount { get; set; }
    public double? MonthlyAmount { get; set; }
    public string GroupID { get; set; }
    public string Display { get; set; }
    public string FrequencyExactness { get; set; }
    public string FrequencyPeriod { get; set; }
    public int? ScoreEmployer { get; set; }
    public int? ScoreDirCr { get; set; }
    public string ScoreWeekday { get; set; }
    public string ScoreFrequency { get; set; }
    public double? ScoreAmount { get; set; }
    public int? ScoreTotal { get; set; }
}

public class Liabilities
{
    public List<Rent> Rent { get; set; }
    public List<Periodic> Periodic { get; set; }
    public List<NonPeriodic> NonPeriodic { get; set; }
    public List<TopUncommittedSpend> TopUncommittedSpend { get; set; }
}

public class Overview
{
    public Income Income { get; set; }
    public Loans Loans { get; set; }
    public Dishonours Dishonours { get; set; }
    public HighRiskMerchants HighRiskMerchants { get; set; }
    public Liabilities Liabilities { get; set; }
}

public class Overviews
{
    public Overview Overview { get; set; }
}

public class Transaction
{
    public int AccountID { get; set; }
    public object TranID { get; set; }
    public string CleanDesc { get; set; }
    public string Category { get; set; }
    public string TranDate { get; set; }
    public double TranAmount { get; set; }
    public int TranBaseTypeID { get; set; }
    public string TranBaseType { get; set; }
    public string GroupID { get; set; }
    public double Balance { get; set; }
}

public class Transactions
{
    public List<Transaction> Transaction { get; set; }
}

public class Account
{
    public int AccountID { get; set; }
    public string AccountNumber { get; set; }
    public string AccountType { get; set; }
    public string AccountName { get; set; }
    public string AccountHolder { get; set; }
    public string SecondaryAccountHolder { get; set; }
    public double? BankAvailableBalance { get; set; }
    public double? BankCurrentBalanceOriginal { get; set; }
    public double? BankCurrentBalance { get; set; }
    public double? CardMinPayment { get; set; }
    public double? CardRunningBalance { get; set; }
    public double? CardLastPaymentAmount { get; set; }
    public double? CardAvailableCredit { get; set; }
    public double? CardTotalCreditLine { get; set; }
    public string CardDueDate { get; set; }
    public string CardLastPaymentDate { get; set; }
    public string CreateDT { get; set; }
    public int ServiceID { get; set; }
    public string BankName { get; set; }
    public string AccountBSB { get; set; }
    public int DishonourCount { get; set; }
    public int DaysRange { get; set; }
    public int accountCategoryId { get; set; }
    public string accountCategory { get; set; }
    public int loanInterestRateTypeId { get; set; }
    public string loanInterestRateType { get; set; }
    public string loanTerm { get; set; }
    public int loanTypeId { get; set; }
    public string loanType { get; set; }
    public int interestRate { get; set; }
    public string dueDateLoan { get; set; }
    public double? overDraft { get; set; }
    public string lastPaymentDate { get; set; }
    public float? MaxAmountOverdraft { get; set; }
    public int? DaysOverdraft { get; set; }
    public double? TotalCredits { get; set; }
    public double? TotalDebits { get; set; }
    public string FirstTransaction { get; set; }
    public string LastTransaction { get; set; }
    public double? DayAgoBalance { get; set; }
    public Overviews Overviews { get; set; }
    public Transactions Transactions { get; set; }
}

public class Accounts
{
    public List<Account> Account { get; set; }
}

public class DecisionPoint
{
    public int CriteriaID { get; set; }
    public int ReportID { get; set; }
    public string Criteria { get; set; }
    public string CriteriaName { get; set; }
    public string Score { get; set; }
    public string ScoreDT { get; set; }
    public int CriteriaTypeID { get; set; }
}

public class DecisionPoints
{
    public List<DecisionPoint> DecisionPoint { get; set; }
}

public class Application
{
    public int AppID { get; set; }
    public int ReportID { get; set; }
    public string AppReference { get; set; }
    public string CreateDT { get; set; }
    public string ClientName { get; set; }
    public string StoreName { get; set; }
    public string Email { get; set; }
    public string StoreCode { get; set; }
    public string AppShortReference { get; set; }
    public string ClientNameShort { get; set; }
    public string StoreNameShort { get; set; }
    public string VerifyEmployer { get; set; }
    public double? VerifyAmount { get; set; }
    public string VerifyFrequency { get; set; }
    public string VerifyWeekday { get; set; }
    public string LocalityCode { get; set; }
    public int TemplateReportID { get; set; }
    public int daysRange { get; set; }
    public string templateReportName { get; set; }
    public Accounts Accounts { get; set; }
    public DecisionPoints DecisionPoints { get; set; }
}

public class Applications
{
    public Application Application { get; set; }
}

public class RootObjectContent
{
    public Applications Applications { get; set; }
}

任何人都可以帮我一直看着这几天!无法发布响应输出但似乎正确回归。

0 个答案:

没有答案