!--a11y-->
Examples for Using the Destination Service
API 
The following examples show how to use the Destination service to set up HTTP(S) connections. The first example shows how to establish the connection using an existing destination. The second example shows how to create a destination using Basic Authentication.
Needed Imports
|
import
com.sap.security.core.server.destinations.api.DestinationService; |

In addition, your application needs classloader references to tc~sec~destinations~service and tc~sec~destinations~interface. For more information about setting references on the SAP J2EE Engine, see Referencing Other Components.
The following example shows how to set up a connection to the HTTP destination dst-1. The URL and user authentication information have been stored in the Destination service and have been maintained in the Visual Administrator. The authentication method that is used for the connection depends on the settings in the destination (none, Basic Authentication, X.509 client certificates, or SAP logon tickets). If the URL saved in the destination uses HTTPS, then SSL with server authentication will be used to secure the connection.
Code Example for Establishing an HTTP Connection Using an Existing Destination
|
DestinationService dstService = (DestinationService) |
The following example shows how to create a new destination dst-2 and store it. All data is stored in the J2EE Engine’s secure storage area. The data is stored encrypted if the SAP Java Cryptographic Toolkit has been installed.
The created destination may be maintained using the Visual Administrator.
Code Example for Creating a New HTTP Destination
|
DestinationService dstService = (DestinationService) |
