Skip to Content
1
Former Member
Apr 25, 2017 at 06:41 PM

Unable to connect IoT Message Management Service to UI5 due to 401 Authorization Error

915 Views Last edit May 26, 2020 at 02:27 PM 3 rev

Hello,

I'm currently attempting to connect the iotmms to a SAP UI5 Application template via the getData() method on a trial account. I'm just a student so I apologize if this issue is trivial. I was using this blog post as a reference: https://blogs.sap.com/2016/04/10/communicate-with-iot-in-your-webide-project/

The issue is the IOT.js getData() method keeps returning a 401 http authorization error in my UI5 application. However, the iotrdms portion using the IOT.js getDevices() works just fine (since that destination is set up correctly).

Here's what it returns when I fire the getData() method with a selected device from the list:

Here is the code in the WebIDE firing this method:

This is my neo-app.json file (set up exactly like the blog post did):

And here is my hcp destinations. Someone suggested the iotmms also needs to include /http at the end of its url but that just returns a http 404 instead of a 401.

I believe it's one of four issues:

  1. The iotmms hcp destination is set up incorrectly.
  2. My neo-app.json file destination is incorrect or there's a new way to set it up.
  3. the authorization header information is incorrect when communicating with getData(). I'm not even sure if the getData() method requires header information or not. I can't find an example anywhere that uses it.
  4. The url I'm attempting to GET from is incorrect.

Strangely enough, the pushData() method (which I assume is using the mms url) is working just fine with or without authorization.

I also updated the message management service and re-injected the IOT.js file but neither seemed to fix it. Someone also suggested turning off authorization on the hcp iotmms destination, but that didn't work either.

If anyone can point me in the right direction on how to fix this I would be incredibly grateful. If you need any other additional information in order to solve this, please let me know.

Thank you,

Garrett

Attachments

401errors.jpg (31.8 kB)
getfocuseditem.jpg (50.9 kB)
neoapp.jpg (24.6 kB)
capture.jpg (32.8 kB)
capture.jpg (57.9 kB)