Skip to Content
1
Jan 20, 2016 at 04:18 PM

Push a message from ABAP to IoT

115 Views

Hello HCP devs,

we try to push some messages from ABAP to HCP IoT MMS.

What we did:

  1. Import hanatrial.ondemand.com server certificate as ANONYM SSL client certificate in STRUST
  2. Create a SM59 type G destination pointing to host iotmmssXXXXXXXXXtrial.hanatrial.ondemand.com:443
    path /com.sap.iotservices.mms/v1/api/http/data/
    SSL active, certificate ANONYM
    Authentication: Basic with User=S-User and Password=valid S-User password
    http version = 1.1
  3. Instanciate a CL_HTTP_CLIENT by destination
  4. put a CL_REST_HTTP_CLIENT on top
  5. set CL_HTTP_CLIENT properties to LOGON_POPUP=disabled, ACCEPT_COOKIE=enabled, redirect=enable
  6. Create a valid JSON message with "sync", ... , message id, device id, values
  7. do a CL_REST_HTTP->POST it to uri=path+DeviceID of the DMS device management
  8. we get a HTML from HCP "Access to the requested resource is not authorized (HTTP 401)"

This is somehow logic because we need (as it is documented in the Java examples) to provide the unique "Bearer OAuth token" as Authorization header but that collides with the basic authentification before.

Any ideas how the ABAP sequence of authentication look like. We checked the OAuth principle docs but how we should map that on ABAP calls ?

Thanks in advance,

Matthias