You are on page 1of 25

How-to Connect your HANA Cloud Platform Mobile Service Account to your On-Premise OData Service

How-to Connect your HANA Cloud Platform Mobile Service Account to your On-Premise OData
Service
How-to

Provided by SAPs Technology RIG

How-to Connect your HANA Cloud Platform Mobile


Service Account to your On-Premise OData Service

Applicable Releases:
HANA Cloud Connector 2.x
HANA Cloud Platform Mobile Services
Version 1.0 - April 2015

Document History
Document Version

Authored By

Description

1.0

Technology RIG

First release of this guide

TABLE OF CONTENTS
1.

Scenario .......................................................................................................................................... 4

2.

Background ..................................................................................................................................... 4

3.

Prerequisites for the Exercise........................................................................................................... 5

4.

Step-by-Step Procedure ................................................................................................................... 6


4.1 Installing the HANA Cloud Connector on Windows............................................................................. 6
4.2 Initial configuration of the HANA Cloud Connector ............................................................................ 8
4.3 Configure backend connections in the HANA Cloud Connector ........................................................ 10
4.4 Connecting remote systems in the Hana Cloud Platform ................................................................. 13
4.5 Creating Initial Application Definition in HCPms ............................................................................... 15
4.6 Creating a Backend Configuration in HCPms .................................................................................... 17
4.7 Creating a Device Registration .......................................................................................................... 20
4.8 Executing the OData service from REST client .................................................................................. 23

1.

SCENARIO

In this document we will go through the process of connecting your HANA Cloud Platform Mobile Services
(HCPms) account to the OData services in your on premise network. We will install the SAP HANA Cloud
connector (HCC) which is an on premise agent that runs in your network and takes care of securely
connecting cloud applications, running on SAP HANA Cloud Platform (HCP), with OData services in your
network. After the installation, we will go step by step though the basic configuration in HCP, HCPms and the
HCC.
Finally we will test the connectivity through HCPms through the HCC all the way to your backend system by
creating an application registration in the HCPms and then requesting the OData service document.
2.

BACKGROUND

You have an HCPms account for managing mobile applications in an on-demand environment. Your
application data resides in your on premise network. You want to securely connect your on-demand
applications with your on premise data.
The SAP HANA Cloud Platform is the in-memory Platform-as-a-Service offering from SAP, which enables
customers and developers to build, extend, and run applications on SAP HANA in the cloud. With flexible
subscription models and optional services for apps, database, and infrastructure, it provides instant access
to the full power of SAP HANA.
This is the landscape model for the HCP connecting to your backend systems. We will be installing,
configuring and/or testing all the gold colored boxes in this picture

3.

PREREQUISITES FOR THE EXERCISE


You need a valid mobile services account on the HANA Cloud Platform. If you dont have an
account, you can get a trial account at https://account.hanatrial.ondemand.com.
:

Be sure to have your Internet browser up to date and use Google Chrome if possible

Hardware prerequisites, for installing the HANA Cloud Connector physical or virtual machine:
Memory: minimum 1 GB RAM, 4 GB recommended
Hard disk space: minimum 1 GB, recommended 20 GB
CPU: minimum single core 3 GHz, dual core 2 GHz recommended\
Operating System requirements:

OData service Provider:


On your network you will have to have a SAP Gateway system or some other way to expose OData
services to the HCPms.
REST Client for testing:
You need to have a tool for making REST calls like the Postman Client in Google Chrome
applications. To get the Postman client go to the Chrome store at
https://chrome.google.com/webstore/category/apps?utm_source=chrome-ntp-icon and search for the
postman rest client

4.

STEP-BY-STEP PROCEDURE

This is the overall sequence of steps in the Exercise:


1.
2.
3.
4.
5.
6.
7.
8.

4.1

Installing the HANA Cloud Connector on Windows


Initial configuration of the HANA Cloud Connector
Configure backend connections in the HANA Cloud Connector
Connecting remote systems in the Hana Cloud Platform
Creating Initial Application Definition
Creating a Backend Configuration
Creating a Device Registration
Executing the OData service from REST client

Installing the HANA Cloud Connector on Windows

...

The cloud connector can run on Linux, Windows or the Mac OS operating systems. For this exercise we are
going to install the Windows OS version. The configuration steps below that are the same no matter which
platform you decide to install the Cloud Connector. If you choose to install on one of the other platforms,
follow the installation instructions and then continue with step 4.2 of this document
Choos e the menu option Fil e -> New -> Pr ojec t

1. Download the Windows .msi HANA Cloud connector file from the link
https://tools.hana.ondemand.com/#cloud

2. Put the installation file on the server were it is to be installed and execute the .msi file to start the
installer wizard
3. Once the wizard starts, click the Next button to start the installation process.

4. Specify the path where you want the software installed. You can leave the default path or change it as
you like

5. Specify the secure port to use for the Cloud Connector. The default port is 8443. If have other things
running on the 8443 port, you may need to change the port.

6. Leave the box checked so the system will automatically start the cloud connector

7. Confirm the start of the installation by clicking the Next button

4.2

Initial configuration of the HANA Cloud Connector

1. Open browser and go to the link https:// <server name>:<secure port> (e.g. https://localhost:8443 if
you are on the same machine)
2. If you get the following error, click on Advanced. This error comes because you dont have yet any
valid certificate for this localhost server

3. Click on Proceed to localhost (unsafe)

4. Enter these credentials and click on Login

User Name

Password

Administrator

manage

5. Choose Master as the installation type since this is your first time you are installing the product and
this is the only SAP HANA Cloud Connector in your system. Click on Apply

6. The first time you log in, you need to change the password. Change it to whatever you like and then
click on Save

7. Connect to your Hana Cloud Platform account. Provide the following initial configuration and click on
Apply. Proxy information is only needed if you are in a network that requires a proxy to communicate
to the internet, like for example the inside your corporate network.
Parameter

Value

Landscape Host

hanatrial.ondemand.com

Account Name

<your account name on the landscape host>. It can be found on the top
left corner of your SAP HANA Cloud Cockpit. Usually it is your S# or I#
followed by the word trial (e,g S000000trial, I000000trial)

4.3

User Name

<your user name on the landscape host> (for the trial account it is your
SCN Use-id)

Password

<your password> (for the trial account it is your SCN password)

HTTPS Proxy Host

only if required

HTTPS Proxy Port

only if required (

Configure backend connections in the HANA Cloud Connector

1. The connector is configured and connected to the Hana Cloud Platform. Now we need to add some
connections with the backend systems. Click on Access Control

2. Click on Add in the Mapping Virtual to Internal System section

3. Enter the following information and click on Save. What you are doing in this step is to assign to a real
backend system a virtual name. In this way you can decouple the cloud based application from the
backend infrastructure. You can also create a virtual port, which of course can be different from the
real one
Parameter

Description

Virtual Host

<whatever you want to call it> (e.g myvirtualhost)

Virtual Port

4321 (It does not have to be the same as the actual port.)

Internal Host

<host name for your OData service provider>

Internal Port

<port for OData service provider>

Protocol

HTTP

Principal Type

kerberos

Back-end Type

SAP Gateway

Example settings:

4. Now you need to add all the resources related to the usages you want to have available to your
application. These resources are the paths to be concatenated with the server URL in order to have
the complete paths to the resources.

Highlight the server entry you just made. In the resources area below click on the Add button

5. Add the resource and click on Save


Parameter

Value

URL Path

<path to your OData service> (e.g. /sap/opu/odata)

Access Policy

Path and all sub-paths

6. At the end you should have something that looks like this configuration

7. Completing the back end configuration your SAP HANA Cloud connector has been properly configured
if the status is green and its connected

8. You have successfully installed and configured your SAP HANA Cloud Connector.
4.4

Connecting remote systems in the Hana Cloud Platform

...

Now that your SAP HANA Cloud Connector is configured with a virtual server pointing to a given real server.
You now have to point to the virtual server you have created and its mappings to it all the related resources
on the Hana Cloud Platform. You are going to setup, in the SAP HANA Cloud Cockpit, a new destination:
this destination will give you access to the backend systems through the Cloud Connector.
These are the actions to perform in order to configure this destination:
Choos e the menu option Fil e -> New -> Pr ojec t

1. From the HANA Cloud cockpit click on the left side on the link Destinations

2. Click on New Destination

3. Enter the following parameters and click on Save


Parameter

Value

Name

mygatewaysystem

Type

Type of connection (e.g. http, rfc)

Description

A description of the connections

URL

http://myvirtualhost:8000 (The virtual URL you defined


in the cloud connector)

ProxyType

Internet

Cloud Connector Version

Authentication

NoAuthentication

When finished click on Save


4. At the end you should have the following configuration:

That concludes the setup and configuration of the HANA Cloud Connector in the HANA Cloud
Platform

4.5

Creating Initial Application Definition in HCPms

1. Log on to the Hana Cloud Platform mobile services (HCPms) from your HCP account by going to
Services and selecting the link Go to Service under the SAP HANA Cloud Platform Mobile Service area

2. Log on to your HCPms administration cockpit. It should look similar to the screen shot below:

3. Click on the Applications option. If this is a new installation you will have no applications listed if this is
your first time creating an application definition. If you have already defined applications, you will get a
list of the defined application in the left column and if you choose an application the basic info will be
on the right hand side of the screen

4. Press the

+ sign to create a new application definition

5. You will get the following popup to start the application definition. The required fields are marked with
an asterisk (*). Fill in the required fields and press the Save button when you are finished. Details of
what should be filled in the screen are provided in the following table.

Field

Value

Application ID

<whatever you want to call it> (e.g. com.sap.flight)

Version

1.0

Name

<anything you want>

Type

Native

Description

(Optional)

Vendor

(Optional)

Security

None

Configuration

4. Once you save your definition you will get a screen that looks something like this. You can then
continue to the next step defining the backend configuration.

4.6

Creating a Backend Configuration in HCPms

1. To complete your Application Definition, you can create the backend configuration from the
application definition screen that was shown in the previous steps by pressing on the Backend icon.

2. Fill in the in the fields on the screen and press the Save button when you are done. The table below
provides information on what goes in to each of the fields
Field
Backend URL

Authentication
Type

Value
<the path to your OData service> Make sure you specify the virtual hose and port not
the actual host and port
(e.g.http://myvirtualhost:8000/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT)
No Authentication

Maximum
Connections

500

Certificate Alias
Rewrite Mode
Relative Paths
Proxy Type

Leave blank.
Rewrite URL on HANA Mobile Server
Leave blank
OnPremise

3. You will get a delay warning saying that the connection was successfully created but it may take up to
5 minutes to be created in the HCP database and cache. So you may have to wait for a bit before you
can continue. Press the OK button to clear the message

4. Click on the application name in the left hand column to bring up the application details again. Notice
your Application URL. This is the back end connection you specified using the virtual server. You can
test the connection from the HCP to you backend system by clicking on the Ping button at the bottom
of the screen

5. If you configured everything right in the cloud connector and the HCP and HCPms you should get a
successful ping

6. That completes the application configuration click the OK button to clear the pop-up and then click the

home button

in the upper left corner of the screen to return to the main screen

Notice that you have an application definition created and also a connection. Any backend you create
in an application definition also get populated in the connections
4.7

Creating a Device Registration

1. To simulate a device registration you can use a REST client tool to issue a POST request to the
application URL you defined in the HCPms cockpit. For this exercise, we will use the Postman
application in the Google Chrome browser. The process will be similar for other tools. Launch the
Postman tool

2. Enter the following information and press the Send button

Field
URL

Value
https://hcpms-<yourtrial>.hanatrial.ondemand.com/odata/applications/latest/<your
application>/Connections
Request Type POST
Header

Content-Type

Form Data

Raw

Type
XML Data

XML
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns='http://www.w3.org/2005/Atom'
xmlns:d='http://schemas.microsoft.com/ado/2007/08/dataservices'
xmlns:m='http://schemas.microsoft.com/ado/2007/08/dataservices/metadata'>
<content type='application/xml'>
<m:properties>
<d:DeviceType>Android</d:DeviceType>
</m:properties>
</content>
</entry>

application/atom+xml; charset=UTF-8

3. If everything was entered correctly, you should get a return code of 201 Created message in the Status
area at the bottom of the screen

4. You can also confirm by logging back on to the HCPms cockpit and now you should see an additional
registration.

5. If you click on the Registrations and Users icon you can see the details

4.8

Executing the OData service from REST client

1. With a new connection to the application defined on the SMP server it is now possible to communicate
with the backend service. In this case just the service document will be retrieved using an HTTP get to
verify that indeed the gateway server is being communicated with
Go back to the Rest client and create a get request with the following information and press the Send
button
Field
URL
Request Type

Value
https://hcpms-<yourtrial>.hanatrial.ondemand.com/<your application>/
(e.g. https://hcpms-i007387trial.hanatrial.ondemand.com/com.sap.flight/)
GET

X-SMP-APPCID

<The Registration ID you created in the above step>

Authorization

The username and password encoded using HTTP BASIC authorization. Note: even
though we defined no authorization in the set-up, if your backend requires
authorization you will need to specify the user and password in the Rest client. You
can specify it in the tool or when you execute it the browser will prompt you for it.

It should look something like this

2. After you press the Send button you should get a 200 Status OK and the service data returned in the
body of the message similar to below

3. That concludes the process of configuring and testing the HCPms and the HCC

www.sap.com

2015 SAP SE. All rights reserved.


SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP
BusinessObjects Explorer, StreamWork, SAP HANA, and other SAP
products and services mentioned herein as well as their respective
logos are trademarks or registered trademarks of SAP AG in Germany
and other countries.
Business Objects and the Business Objects logo, BusinessObjects,
Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and
other Business Objects products and services mentioned herein as
well as their respective logos are trademarks or registered trademarks
of Business Objects Software Ltd. Business Objects is an SAP
company.
Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL
Anywhere, and other Sybase products and services mentioned herein
as well as their respective logos are trademarks or registered
trademarks of Sybase Inc. Sybase is an SAP company.
Crossgate, m@gic EDDY, B2B 360, and B2B 360 Services are
registered trademarks of Crossgate AG in Germany and other
countries. Crossgate is an SAP company.
All other product and service names mentioned are the trademarks of
their respective companies. Data contained in this document serves
informational purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials
are provided by SAP AG and its affiliated companies ("SAP Group")
for informational purposes only, without representation or warranty of
any kind, and SAP Group shall not be liable for errors or omissions
with respect to the materials. The only warranties for SAP Group
products and services are those that are set forth in the express
warranty statements accompanying such products and services, if
any. Nothing herein should be construed as constituting an additional
warranty.