当我查询 salesforce REST 时,API (/services/data/v29.0/query?q=select+id,Name,AccountNumber,OwnerId,Site,Description,NumberOfEmployees,Fax,Industry,Phone,Website,Type+from+Account+where+id='0019000000NMrbv')
我得到以下响应。
{
    "attributes" : {
      "type" : "Account",
      "url" : "/services/data/v29.0/sobjects/Account/0019000000NMrbvAAD"
    },
    "Id" : "0019000000NMrbvAAD",
    "Name" : "Test G",
    "AccountNumber" : null,
    "OwnerId" : "00590000001BpGnAAK",
    "Site" : null,
    "Description" : null,
    "NumberOfEmployees" : null,
    "Fax" : null,
    "Industry" : null,
    "Phone" : null,
    "Website" : null,
    "Type" : null
}
现在我创建了一个如下所示的顶点休息服务,上面的查询相同
@HttpGet
 global static Account doGet(){
    Account acc = [select id,Name,AccountNumber,OwnerId,Site,Description,NumberOfEmployees,Fax,Industry,Phone,Website,Type from Account where id ='0019000000NMrbvAAD'];
    return acc;
}
当我调用此服务时,我得到的响应是
{
   "attributes":    {
      "type": "Account",
      "url": "/services/data/v29.0/sobjects/Account/0019000000NMrbvAAD"
   },
   "Name": "Test G",
   "OwnerId": "00590000001BpGnAAK",
   "Id": "0019000000NMrbvAAD"
}
现在请比较上述2个响应。来自顶点休息服务的响应没有具有空值的字段。
我们创建了一个 salesforce ios 本机应用程序。该服务使用标准的 REST api,但由于性能问题,我们计划创建 APEX 休息服务,但由于这种响应差异,我们将不得不在许多地方更改代码来处理这个问题。
有没有人遇到过这样的问题,如果你建议如何处理这个问题会很有帮助?我们可以做点什么,以便顶点休息服务返回与标准 saleforce REST api 相同的响应。