<dependency>
<groupId>com.sap.it.public</groupId>
<artifactId>generic.api</artifactId>
<version>.X.X/version> <!— Replace with the downloaded version -- >
<scope>system</scope>
<systemPath>
${project.basedir}/src/main/resources/com.sap.it.public.generic.api-2.X.X.jar
</systemPath>
</dependency>
<dependency>
<groupId>com.sap.it.public</groupId>
<artifactId>adapter.api</artifactId>
<version>2.x.x</version> <!— Replace with the downloaded version -- >
<scope>system</scope>
<systemPath>
${project.basedir}/src/main/resources/com.sap.it.public.adapter.api-2.X.X.jar
</systemPath>
</dependency>
import com.sap.it.api.ITApiFactory;
import com.sap.it.api.ccs.adapter.CloudConnectorContext;
import com.sap.it.api.ccs.adapter.CloudConnectorProperties;
import com.sap.it.api.ccs.adapter.ConnectionType;
CloudConnectorContext context = new CloudConnectorContext();
context.setConnectionType(ConnectionType.HTTP);
CloudConnectorProperties props = ITApiFactory.getService(CloudConnectorProperties.class, context);
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);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
38 | |
19 | |
14 | |
12 | |
10 | |
10 | |
10 | |
8 | |
8 | |
8 |