on 2023 Sep 29 5:19 AM
Hi Everyone,
We are using SDK 7.0.0, calling CreateMedia method in the dataService class to attach as stream which is internally calling the AttachmentContentSet entity of the backend API. The attachment is getting created in the backend however, the SDK is calling the API twice, its creates the attachment first time and is throws an error "Method 'ATTACHMENTCONTEN_GET_ENTITY' not implemented in data provider class".
The SDK is performing a second HTTP "POST" instead of a "GET". As per note 3324935 I can confirm the $value is also being sent.
AttachmentContentSet(DocumentInfoRecordDocType='GOS',DocumentInfoRecordDocNumber='EXT48000000000074',DocumentInfoRecordDocVersion='00',DocumentInfoRecordDocPart='000',LogicalDocument='000C29A5CF231EDE96F349C59E028988',ArchiveDocumentID='000C29A5CF231EDE96F349C59E02A988',LinkedSAPObjectKey='4500000118',BusinessObjectTypeName='BUS2012')/$value
Regards,
Prashanth
Request clarification before answering.
The usual steps taken by createMedia are:
(1) POST the media content.
(2) If no content is returned in the response (e.g. it returns 204 No Content), we send a GET request to get the value(s) of any non-media properties that the server might have generated. (If the server doesn't return payload for the initial POST and won't respond to that subsequent GET request, that makes it rather difficult to get any non-media generated properties back to the client, so I would encourage you to ask the server team to address that).
(3) Per OData Version 4.01. Part 1: Protocol (oasis-open.org), "It is not possible to set the structural properties of the media entity when creating the media entity." So we subsequently send a PATCH (OData 4+) or MERGE (OData 3-) to set any non-media properties that the client might have wanted to set along with the media content. Since MERGE (for OData V3-) isn't a standard HTTP verb, in that case we send this request as a POST with header X-HTTP-Method containing the MERGE verb.
To disable step 2 see https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/reference/android/java...
To disable step 3 see https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/reference/android/java...
Bear in mind that steps 2 and 3 have a well-defined purpose and if the backend doesn't support them I would encourage you to contact the team that built that server and ask them to make improvements.
But meanwhile the above-mentioned ServiceOptions settings should suffice to avoid the issues that you described.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Evan, will check and let you know the outcome.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
33 | |
21 | |
16 | |
8 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.