We are trying to call OData and REST endpoints in an S/4HANA On Premise system from our SAP Cloud Platform Java app. However, our attempts to use the SAP CloudSDK to get an HTTP client for the corresponding destination
Destination destination = DestinationAccessor.getDestination(destinationName);
HttpClient client = HttpClientAccessor.getHttpClient(destination.asHttp());
fails with the exception
com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException:
Failed to get on-premise proxy headers.
We are at a loss at what's causing it. The text also isn't very specific about what is missing. "Proxy headers", okay. But what are they, and where do I maintain them, and for what? None of the blogs 1 2 we've referred to mentions anything of the kind.
Our Destination looks as follows:
- Name: ABC
- URL: http://abc:445/sap/opu/odata/sap/SOME_ODATA_SRV
- Proxy Type: OnPremise
- User: MYUSER
- Password: ******
- sap-client: 123
It points to a Cloud Connector that exposes a back-end system:
- Host: abc:445
- Protocol: HTTP
- Back-End Type: ABAP System
Connection check is successful.
I finally found the piece of code that throws the exception in method getHeadersForOnPremiseSystem
of class ConnectivityService
in library cloudplatform-connectivity-scp-cf
, which apparently fails to resolve headers that are related to the XSUAA service using a PrincipalPropagationStrategy
. That makes me wonder: as far as I know, principal propagation is for frontend access to Fiori apps. But we only want to call an OData endpoint, hence neither need nor want to configure that.
What are we missing or doing wrong?