on 02-04-2015 11:33 PM
I have been attempting to discover if SAP supports content ID referencing in Gateway oData calls. The answer appears to be no.
Firstly sorry Thomas Jung for stuffing up your chi in the XSODATA threads, http://scn.sap.com/thread/3604817 should have posted here instead
If you're working with say, a .net application using Microsoft library System.data.services.client (v3.5.00) that forms up your oData batch calls, you can't create a deep entity structure the same way we do with JSON for example.
Instead the Microsoft library has to rely on "setLink" or "addLink" which refers to the content ID referencing method for processing $batch calls.
Our older documentation states it's not supported but there were rumours this functionality may have been planned for support, but clearly ( as the below code suggests ) we're not there yet with Gateway SP08 (740)?
Class: /IWFND/CL_SODATA_PROCESSOR
Method: check_content_reference.
DATA: lv_char TYPE char1,
lv_path_translated TYPE string,
lx_mgw_busi_exception TYPE REF TO /iwfnd/cx_mgw_busi_exception.
* PATH_TRANSLATED contains '$' as first character
lv_path_translated = io_request->get_header_field( if_http_header_fields_sap=>path_translated ).
lv_char = lv_path_translated.
IF lv_char <> '$'. EXIT. ENDIF.
* Create and raise a Business Exception
TRY.
CREATE OBJECT lx_mgw_busi_exception
EXPORTING
textid = /iwfnd/cx_mgw_tech_exception=>rfc_system_error
remote_error_unlimited = 'Referencing requests in a changeset not supported'. "#EC NOTEXT
RAISE EXCEPTION lx_mgw_busi_exception.
CATCH /iwfnd/cx_mgw_busi_exception INTO lx_mgw_busi_exception.
raise_business_error( lx_mgw_busi_exception ).
ENDTRY.
For anyone reading this, what I'm referring to by Content-ID referencing, an example batch call is below ( I've hacked this down so it's clearer but should illustrate the process 😞
POST /service.svc/Customers HTTP/1.1
Host: host
Content-Type: application/atom+xml;type=entry
Content-Length: ###
Content-ID: 1
POST /service.svc/Address HTTP/1.1
Host: host
Content-Type: application/atom+xml;type=entry
Content-Length: ###
Content-ID: 2
Content-Type: application/http
Content-Transfer-Encoding: binary
POST $1/$links/SOME_NAV_ID_HERE HTTP/1.1
Content-Type: application/json
You're basically wanting the Gateway framework to understand that Customers is linked to Addresses ( Content ID 1 and Content ID ) and we should create a deep insert if this is sent in a payload.
POST $1/$links/SOME_NAV_ID_HERE HTTP/1.1
This line is the most interesting, as when the standard SAP method check_content_reference is called, it will ALWAYS raise an exception as the line starts with "$". This is the link between the two objects in the payload and the exception tells me content ID referencing is not supported.
Do we have some definitive statements on when/if/why this will be supported?
Cheers
Leigh
Hi Leigh,
SAP Gateway now (SAP NetWeaver 740 SP13) supports content id referencing.
$batch Processing - SAP Gateway Foundation (SAP_GWFND) - SAP Library
Though it is listed as a constraint on that page (a typo) you will find the description at the bottom of the page mentioned above
Best Regards,
Andre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1574568 - SAP NetWeaver Gateway 2.0 - Known Constraints
Also, from what I understand OData Version 4.0 in future SAP Gateway will support content-id referencing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.