cancel
Showing results for 
Search instead for 
Did you mean: 

Fetch entity: no error but response is empty

former_member321811
Participant
0 Kudos

Hi,

I have a weird issue when I fetch one of my entities: I don't have any error but the response is empty (I enabled trace logging to see what was going on).

{
  "d":
  {
    "results": []
  }
}

The thing is, this used to work just fine.

When I execute the same request in the backend (GW client), I get the expected result. When I test the destination in the mobile services dev & ops and select the same entity, I also get some data. I also used the assistant to re-generate the proxy classes. I have a master detail app generated with the assistant and the response is also empty for this entity but everything seems to work just fine for the other entities.

How am I supposed to debug this? 🙂

Cheers,

Pierre

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member321811
Participant
0 Kudos

andreas.schlosser here's what I have in the console:

2017-12-13 14:49:50.567799+0100 Inventory[19622:4369040] [general] # SAP.OData.HTTP - DEBUG - (0x60000026e980) - SAP.OData.HTTP.Thread-7 - [ZEntities] Request: GET https://hcpms-xxxxxxxxxxxtrial.hanatrial.ondemand.com/mydestination/Entities?$select=*
2017-12-13 14:49:50.569700+0100 Inventory[19622:4369040] [general] # SAP.OData.HTTP - DEBUG - (0x60000026e980) - SAP.OData.HTTP.Thread-7 - [ZEntities] Request Headers:
{
  "Accept": "application/json",
  "DataServiceVersion": "2.0",
  "MaxDataServiceVersion": "2.0"
}
2017-12-13 14:49:50.575248+0100 Inventory[19622:4369040] [general] # SAP.OData.HTTP - DEBUG - (0x60000026e980) - SAP.OData.HTTP.Thread-7 - [ZEntities] Request Content:
2017-12-13 14:49:52.142189+0100 Inventory[19622:4369040] [general] # SAP.OData.HTTP - DEBUG - (0x60000026e980) - SAP.OData.HTTP.Thread-7 - [ZEntities] Response: status code = 200, status text = no error, time = 1575 ms
2017-12-13 14:49:52.142824+0100 Inventory[19622:4369040] [general] # SAP.OData.HTTP - DEBUG - (0x60000026e980) - SAP.OData.HTTP.Thread-7 - [ZEntities] Response Headers:
{
  "Cache-Control": "no-store, no-cache",
  "Content-Encoding": "gzip",
  "Content-Length": "40",
  "Content-Type": "application/json;charset=utf-8",
  "Date": "Wed, 13 Dec 2017 13:49:52 GMT",
  "Server": "SAP",
  "Set-Cookie": "SMP_COOKIE_STORE_fc98b35aa4fd13f1e665daa3950801d_0=H4sIAAAAAAAAAL1S23KbMBD9F8_kLUlx7MZJZvqwQgILLBIBdoI7nQzGWNwMtrERptN_r2immeQD2hetdvfs7tHqfP85KMNtPHgYsMCDJ897vBlcDpqwOPUxyHjLMEOAxBmwAAagbA6OAAE6AIV3q85gCBh6DAaEpkAEuPAZhxSICZCACTgSWsAUGIeu95kEre-NOBCAvmEAUKgyDrrL8cXNBhaBFMLwkMj3SZ6a91JDSNpCxTCjFD1JisAnMwa5ibz6ESQNVTepy8CyqyVNmsgBHiEWUDTNdB3cSgdOZIRRzngtdR7gBecmkRZxfRIxVJkwnBM9Yf5cMzg13PP6xdEocZrV83C42hZa7BOfIfKGa5n9hlsXQYrQvCNzhujf3MzzQbIMWieLzk4XtBiDjYSzQMB80NbUBUr1FBboHJlEkJ6PYcsxhqQyFHLNkDB1b296dDXCnFjQkdnnXRA5hY9vzQ3G716wT0bMpy3rSOfgvHOMStJPO8kJcwNi6Leri5thGclny1uF1nxZK3erI0RpGKLsz17Paj4bjxVnMsughsRtm7tnL7JlECr0kt8lkHqZJazVROyAzqHd7SfT8b0c3wZiOqobX7tXn5n6TRdoF6O1ktsuPtRpfYzL4-BhExZ1fDlYV9swLZUEm_RwPIXFtUjW1_FuU1xHSV8RHhOV_KKudRydDvF7YdP3qlSl9uvyXdtK2a8e8Tz66FD8ak7x61dN-6DzKgknqd3YyW7Z6iU-Y0qrSckXm0MpMJqW1Z4EV6NTyFb0PzGuw93VqY4PUVUe4_b4gWufiYpUjf729oh_xOXHbwMMnmobBAAA; Expires=Tue, 08-Dec-2037 13:49:52 GMT; Path=/; Secure; HttpOnly",
  "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
  "X-SMP-LOG-CORRELATION-ID": "056b86f6-18ae-4e46-a17c-2869399583a2",
  "dataserviceversion": "2.0",
  "sap-metadata-last-modified": "Fri, 08 Dec 2017 13:38:15 GMT"
}
2017-12-13 14:49:52.146528+0100 Inventory[19622:4369040] [general] # SAP.OData.HTTP - DEBUG - (0x60000026e980) - SAP.OData.HTTP.Thread-7 - [ZEntities] Response Content: (pretty printed)
{
  "d":
  {
    "results": []
  }
}
2017-12-13 14:49:52.147578+0100 Inventory[19622:4369040] [general] # SAP.OData.HTTP - DEBUG - (0x60000026e980) - SAP.OData.HTTP.Thread-7 - [ZEntities] Response: data length = 20 (unzipped)

Cheers,

Pierre

aschlosser
Employee
Employee
0 Kudos

Pierre, sorry about the delay - somehow I missed your response here. Ideally, this is not a problem anymore; but if it still is, can you confirm that accessing https://hcpms-xxxxxxxxxxxtrial.hanatrial.ondemand.com/mydestination/Entities?$select=* in a browser also returns an empty response? I'd like to understand if there's something in the SDK stack that causes the problem.

Thanks
Andreas

former_member321811
Participant
0 Kudos

Hi Andreas,

When I try to open this URL in Chrome I get the following error:

HTTP Status 403 - Neither Application connection id nor Application id is provided.

Cheers,

Pierre

aschlosser
Employee
Employee
0 Kudos

I would love if I'd get email notifications for your responses here...

Can you add an additional query parameter to the URL - &x-smp-appid=YOUR_APP_ID

Thanks
Andreas

former_member321811
Participant
0 Kudos

Hi Andreas,

I just did and the data is successfully retrieved from the server when I do so.

There's something wrong with this entity and the SDK but I can't find the issue. It just looks like the other entities, I can't find any meaningful difference in the metadata.

Cheers,

Pierre

aschlosser
Employee
Employee
0 Kudos

Pierre,

Sounds odd... I'd try to turn on all the debugging flags for SAPOData - see https://help.sap.com/doc/978e4f6c968c4cc5a30f9d324aa4b1d7/Latest/en-US/Documents/Frameworks/SAPOData..., section "Debugging"

Maybe there's something unexpected in the request that we're producing?

Andreas

Logger.shared(named: "SAP.OData").logLevel = .debug

    service.traceRequests = true
    service.prettyTracing = true
    service.traceWithData = true
former_member321811
Participant
0 Kudos

Hi Andreas,

I already did this and that's how I found out the response was empty. When I execute the exact same query in the gateway client, I get the expected response.

Cheers,

Pierre

aschlosser
Employee
Employee
0 Kudos

Pierre,

Is it possible for you to post the complete log for this request? In particular all the headers etc. that we send to the backend.
If you can find server logs in the Mobile Services Cockpit under Analytics->Logs that belong to that request, would be great if you can share them too.

Thanks
Andreas