Quantcast
Channel: SCN : All Content - SAP HANA Cloud Platform Developer Center
Viewing all articles
Browse latest Browse all 3285

Push a message from ABAP to IoT

$
0
0

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


Viewing all articles
Browse latest Browse all 3285

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>