Part 1: Configuring a K2 connect Destination
In this tutorial, we will configure a new K2 connect destination from an existing K2 connect installation. We will create a SAP destination to expose a sample shared SAP IDES (Internet Demonstration and Evaluation System) system.
Configure a new K2 connect Destination
K2 connect destinations are simply the connection configurations to a specific SAP server. We will configure our connection string to include the SAP username and password so that we do not have to provide credentials as we proceed through these initial tutorial steps.
In this step, we will launch the K2 connect Administration console and add a new destination to the SAP server that we will use to expose properties and methods for our exercises.
Step 1 Tasks
- Launch the K2 connect Administration console, then edit the Settings. Access the Configure Destinations screen and delete any pre-existing destinations.
- Add a new destination with the following settings:
- Name: K2LearningSAP
- Description: SAP Learning Environment
- Connection String: ASHOST=23.23.150.97 SYSNR=KR3 CLIENT=900 USER=k2learning PASSWD=K2pass!
- Test the new connection, making sure the option to use Predefined User Credentials is CHECKED.
- Set K2LearningSAP as the Default Destination.
- Launch the K2 connect Administration console. (Start > scroll to K > K2 connect for SAP > K2 connect Administration)
- Once the console has loaded, click Settings. Notice that you are connected to the dlx machine (with dlx being the machine name of the virtual environment). If you are working in your own environment, your machine is likely to be different. On the K2 connect Server Configuration screen, click Configure Destinations to begin setting up the new destination.
- If there is a destination shown, right-click the name and select Destinations > Delete. Click Yes for the confirmation.
- Now we'll add the new destination. Right-click on the SAP R4.7 node and click Destinations > Add. (If you do not see the SAP R4.7 node you can add this destination to any other node or create a new one.)
- On the K2 connect Destinations screen, enter or copy/paste the following settings:
- Name: K2LearningSAP
- Description: SAP Learning Environment
- Connection String: ASHOST=23.23.150.97 SYSNR=KR3 CLIENT=900 USER=k2learning PASSWD=K2pass!
- After clicking OK, you will see a prompt asking if you want to test the connection. Click Yes. On the Login to Destination screen, CHECK the box to use Predefined User Credentials, then click OK to launch the test.
- Right-click K2LearningSAP and select Set as Default Destination.
- Click K2 blackpearl Settings. Select the SAP Authentication option, Static Credentials. Enter the SAP login credentials:
Username: k2learning
Password: K2pass!
then select Yes when you are prompted to refresh the Service Instance and Yes once again when you are prompted about restarting the K2 connect Server.
Notice that the ERP Connect adapter is already registered and that the SAP R4.7 system is registered. There may or may not be an existing destination. If there is a destination already in place, we will delete it prior to adding the destination we will use in our tutorial exercises.
Notice that the connection string contains the username and password required for the SAP credentials. We can embed the credentials in this manner or we can configure the K2 connection to the SAP environment to use single sign-on. We will expand on these options in a later step.
We do not need to enter our credentials because they are included in the connection string we just added. In a later step, we will remove the credentials from the connection string, then test the connection by manually entering the username and password. If you see the Connection tested successfully dialogue, click OK to continue.
The next action we need to take is to set the K2LearningSAP destination as the default destination. If we do not complete this action, we are likely to receive errors later on when we attempt to publish our service object from Visual Studio.
One last configuration we need to set while still in the K2 connect Administration console, is the static login credentials for K2. Recall we included the SAP username and password in the connection string when we created the destination. This allows the K2 connect server to communicate with the SAP environment. In a later step, we will use the SmartObject Service Tester to test the connection from a K2 perspective. We need to enter the username and password once again for the K2 interaction to function without error.
In a later step, we will change the SAP Authentication and observe the new behavior in the SmartObject Service Tester.
Step 1 Review
In this step we launched the K2 connect Administration console and added a new destination to our sample SAP environment. We also noted that the SAP username and password were embedded in the connection string. This is important to remember as in later steps, we will remove the login credentials and configure K2 for single sign-on.
In Testing the K2 connect Service Object and K2 SmartObject, we will test the SAP connection, add a new Service Object and automatically generate a SmartObject from the Service Object. We will also configure K2 to use Single Sign On (SSO) cached credentials for making the call to the SmartObject method.