New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OdataV4 in sapui5 #2984
Comments
Hello @siasty , |
Hi @siasty , |
OK, I just need to prepare new app, I only checked on the webide. |
Hi, |
Hi, the problem occurs but I noticed that when I run the application locally there is no error |
Dear sender, I can not see anything on that app. I can neither reproduce nor identify your error. Regards |
hi, when checking batch request we receive status code 200 but data not loaded to table --batchresponse_9e53c3eb-655f-491d-b222-f575f25f6032 HTTP/1.1 200 OK {"@odata.context":"http://51.68.141.73/odata/$metadata#Products(Id,Name)","value":[{"Id":1,"Name":"Cola"},{"Id":2,"Name":"Fanta"},{"Id":3,"Name":"Pepsi"},{"Id":4,"Name":"Sprajt"}]} |
Hi, thanks I see it now. You mentioned that when you run locally there is no error. Currently you are using the UI5 version 1.81.0 (built at 2020/08/12 14:09h). Is this also the version you use locally? Regards |
Yes exactly, I don't have this problem locally |
Hm, as @uhlmannm already said the batch response --batchresponse_f3fab6fa-8b47-4bad-813c-59a9c74b8769 HTTP/1.1 200 OK {"@odata.context":"http://51.68.141.73/odata/$metadata#Products(Id,Name)","value":[{"Id":1,"Name":"Cola"},{"Id":2,"Name":"Fanta"},{"Id":3,"Name":"Pepsi"},{"Id":4,"Name":"Sprajt"}]} does not get correctly deserialized. He also mentioned the problem A bacht response should look like: HTTP/1.1 200 OK {"@odata.context":"$metadata#SalesOrderList(CurrencyCode,GrossAmount,Note,SalesOrderID,SO_2_BP(BusinessPartnerID,CompanyName))","@odata.metadataEtag":"W/"20200825150822"","@odata.count":"5153","value":[...]} So if I understand that correct the http://51.68.141.73/odata/ must vanish from the batch response. Regards |
I don't really understand why response does not get correctly deserialized. --batchresponse_0cb702ce-a606-4ac9-94ee-e9bd2d164272 HTTP/1.1 200 OK {"@odata.context":"http://localhost:5000/odata/$metadata#Products(Id,Name)","value":[{"Id":1,"Name":"Cola"},{"Id":2,"Name":"Fanta"},{"Id":3,"Name":"Pepsi"},{"Id":4,"Name":"Sprajt"}]} and not working --batchresponse_f3fab6fa-8b47-4bad-813c-59a9c74b8769 HTTP/1.1 200 OK {"@odata.context":"http://51.68.141.73/odata/$metadata#Products(Id,Name)","value":[{"Id":1,"Name":"Cola"},{"Id":2,"Name":"Fanta"},{"Id":3,"Name":"Pepsi"},{"Id":4,"Name":"Sprajt"}]} is only in the address in response. That shouldn't be a problem |
Hi,
Regards |
Hi, runtime lib and Ui5 is the same in both cases. M. |
Ok just to ask again if I understand: The server of local host is a WINDOWS but the server for your URL here is a LINUX. Regards |
Yes localhost is a windows |
Hi, ok I checked again with the team and there seems also to be another similar issue addressing that problem. Regards |
Hi, I can not verify that. What comes during the javascript code directly from the server has no \r carriage return., Regards |
Hi, to simulate batch request i copy reqest from app. --batch_id-1597058164852-14 GET Products?$orderby=Name&$select=Id,Name&$skip=0&$top=20 HTTP/1.1 --batch_id-1597058164852-14-- i also write unit test in .net to check first boundry in respond (result in first coments) |
Hey, but all copying you do here goes through autoformat of editors. Regards |
@siasty: can you please open the two app variants (local vs. public deployment) and for both of them record and save a HAR file in the Chrome developer tools? When you open those HAR files in a text editor, you can search for the When I do the same for the public deployment (http://51.68.141.73/), I get the following base64 (1) encoded string: "content": {
"size": 468,
"mimeType": "multipart/mixed",
"compression": -12,
"text":
"LS1iYXRjaHJlc3BvbnNlXzZiNzc1Mjc3LWI3MTUtNDJlOS04ZTE3LTllODBiZTA2ZDRmOApDb250ZW5\
0LVR5cGU6IGFwcGxpY2F0aW9uL2h0dHAKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogYmluYXJ5Cg\
pIVFRQLzEuMSAyMDAgT0sKT0RhdGEtVmVyc2lvbjogNC4wCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb\
24vanNvbjsgb2RhdGEubWV0YWRhdGE9bWluaW1hbDsgb2RhdGEuc3RyZWFtaW5nPXRydWUKCnsiQG9k\
YXRhLmNvbnRleHQiOiJodHRwOi8vNTEuNjguMTQxLjczL29kYXRhLyRtZXRhZGF0YSNQcm9kdWN0cyh\
JZCxOYW1lKSIsInZhbHVlIjpbeyJJZCI6MSwiTmFtZSI6IkNvbGEifSx7IklkIjoyLCJOYW1lIjoiRm\
FudGEifSx7IklkIjozLCJOYW1lIjoiUGVwc2kifSx7IklkIjo0LCJOYW1lIjoiU3ByYWp0In1dfQotL\
WJhdGNocmVzcG9uc2VfNmI3NzUyNzctYjcxNS00MmU5LThlMTctOWU4MGJlMDZkNGY4LS0K",
"encoding": "base64"
}, Decoding this gave the following content (Hex representation, I've manually inserted blanks before each 0a and a newline after it):
From my POV, this proves that the browser receives a 0x0a only, no 0x0d before (2). When you do the same for your local setup, we would expect to see a 0x0d 0x0a there. This still would not explain where the difference comes from, but we hopefully would be at the same page regarding why the UI5 OData model fails to parse the response. (1) browsers might chose to base64 encode the content field when it might contain binary data, see the HAR file spec for details, if interested
|
thank you! |
Hi @siasty , |
Hi, I am opening again and asking for help!
I wrote the controller test and it does not agree with what is written.
as you can see boundry return \r\n
new link for odataV4 http://51.68.141.73:5000/odata/
and error in fiori app
Best regards Maciej
..................................................................................................................................................
Hi Maciej (@siasty ),
the issue seems to be with the response. Let me start with https://www.ietf.org/rfc/rfc2046.txt:
When checking in _Batch, function _deserializeBatchResponse I observe that the first boundary is not detected. This is because the CR (ASCII 13, \r) is missing. You can check yourself by setting a breakpoint in the mentioned function. In my cases
sResponseBody.charCodeAt(52)
shows the LF (ASCII 10, \n).sResponseBody.charCodeAt(51)
does not return 13 assResponseBody[51]
is the last character of the boundary, e.g. 6.Could you please check why your service is not returning the CR as specified in RFC2046?
Best regards
Mathias.
Originally posted by @uhlmannm in #2830 (comment)
The text was updated successfully, but these errors were encountered: