Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 

SAP Cloud Integration offers Adapter Development Kit (ADK) to develop custom adapters. This blog describes the steps required to implement on-premise connectivity from the custom adapter.

Using ADK on CPI, you can now develop custom adapters which can also connect to on-premise systems.


  1. I assume that you are already experienced with the development of custom adapters using ADK on CPI. Incase if you are new to adapter development using the ADK on CPI, You can get started here

  2. Cloud Connector is already installed and the on-premise system is configured in the cloud connector.


The below diagram shows how SAP Cloud Integration establishes the connection to the on-premise system.

Developing the custom adapter:

  1. Download the Generic API and Adapter API bundles from the CPI Tools page.

2.Add the and file to the resources folder that is in your ADK project.

3.Add the generic.api.jar and adapter.api.jar as a dependency in the pom.xml as shown below:
<version>.X.X/version> <!— Replace with the downloaded version -- >
<version>2.x.x</version> <!— Replace with the downloaded version -- >

4. Add the group ID to the <excludeGroupIds> in the pom.xml.

5. In order to achieve the on-premise connectivity from the receiver adapter, you need to import the below classes on * class

Retrieve the cloudconnector properties with the below code snippet:
CloudConnectorContext context = new CloudConnectorContext();
CloudConnectorProperties props = ITApiFactory.getService(CloudConnectorProperties.class, context);

6. Using the above retrieved properties, you can write the below sample code to establish http connection to the on-premise system.
String virtualAddress = endpoint.getAddress()  <!— Should match the address configured in the cloud connector virtual address -- > 
String locationId = endpoint.getLocationId(); <!- Optional field -->
String proxyHost = props.getProxyHost();
String proxyPort = props.getProxyPort();
Map<String, String> additionalHeaders = props.getAdditionalHeaders();

// create and prepare the client
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(address);
HttpHost proxy = new HttpHost(proxyHost, proxyPort);
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
if (locationId != null) {
httpGet.setHeader("SAP-Connectivity-SCC-Location_ID", locationId);
setAdditionalHeaders(additionalHeaders, httpGet);

That’s all. Now your custom adapter should be able to connect to on-premise system.