隐藏Web服务中响应对象的空值

时间:2015-02-23 08:42:09

标签: c# .net json web-services

我有一个返回对象(响应)的Web服务。该对象包含依赖于请求类型的参数。

我想隐藏响应中的空参数,以便它只返回与提交的请求相关的参数

JSon回应:

{
    "ProcessRequestJsonResult":" 
    {
        \"RequestTypeId\":0,
        \"StatusCode\":2010,
        \"status\":null,
        \"ResponseMessage\":\"Customer is assosiated with another request\",
        \"ResponseLanguage\":null,
        \"LandLineAreaCode\":null,
        \"LandLine\":null,
        \"LandLineOwner\":null,
        \"Conts\":null,
        \"Ownership\":null,
        \"OwnershipString\":null,
        \"Co\":null,
        \"ContractDate\":\"\\\/Date(-62135596800000)\\\/\",
        \"BillingCycle\":null,
        \"BillingLog\":null,
        \"ActivationDate\":\"\\\/Date(-62135596800000)\\\/\",
        \"FirstLoginDate\":\"\\\/Date(-62135596800000)\\\/\",
        \"CustomerTechnicalDetails\":null,
        \"CustomerQuota\":null,
        \"CustStat\":null,
        \"CurrentStatus\":null,
        \"Case\":null,
        \"CustomerProducts\":null,
        \"CustomerTransaction\":null,
        \"Discount\":null,
        \"IdType\":null,
        \"IdNumber\":null,
        \"Idtables\":null
    }"
}

我想隐藏任何等于null的返回参数。有没有人知道它是否可能

0 个答案:

没有答案
相关问题