on 2017 Apr 25 7:41 PM
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:
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
Request clarification before answering.
regarding the iotmms destination and nea-app.json, if you have "http" in the destionation then you don't need "entryPath": "/http" in your neo-app.json. Otherwise, if you have "entryPath": "/http" in neo-app.json then you don't need "http" in your iotmms destination.
And error code 401 means Unauthorized: Access is denied due to invalid credentials. Since you can get this error seems like your destination, neo-app.json and the GET url are all correct.
so I suspect there is something wrong with your OAuth token. Pls make sure you generated the token correctly, and also make sure your iot service is configured as well.
Pls refer to Configuring OAuth 2.0 for more details
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
56 | |
10 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.