Skip to Content
0

SAP Machine learning image classifier service in sapui5 app not working

Mar 28 at 03:38 PM

14

avatar image

Hello, I've followed some tutorials to use ml imageclassifier service with sapui5 application developed with web ide. I try to use service directly on SAP API Business Hub (https://api.sap.com/shell/discover/contentpackage/SAPLeonardoMLFunctionalServices/api/image_classification_api?section=OVERVIEW) and everything it's ok, then I get the API Key and use it in code, but no one application is working. I use the following tutorials (link below) and I get this errors:


- https://blogs.sap.com/2018/01/19/consume-machine-learning-api-in-sapui5/

ERROR (console): Failed to load resource: the server responded with a status of 400 (Bad Request) extended_runnable_file.html:1 Failed to load https://sandbox.api.sap.com/ml/imageclassifier/inference_sync: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://webidetesting9605175-s00xxxxxxx3trial.dispatcher.hanatrial.ondemand.com' is therefore not allowed access. The response had HTTP status code 400. Main.controller.js?eval:58 library.css Failed to load resource: the server responded with a status of 404 (Not Found)

--------------------------------------------------------------------------------------------------------------------
- https://www.sap.com/developer/tutorials/ml-fs-sapui5-img-classification.html

ERROR (dialog): Error 400 : This service requires at least 1 file. Please put your file(s) into the `files` field of the POST request

ERROR (console): Failed to load resource: the server responded with a status of 400 (Bad Request) - Failed to load resource: the server responded with a status of 404 (Not Found)

--------------------------------------------------------------------------------------------------------------------

- https://blogs.sap.com/2017/08/11/sap-leonardo-machine-learning-api-with-a-ui5-application/

ERROR (console): Failed to load resource: the server responded with a status of 404 (Not Found) extended_runnable_file.html?hc_orionpath=%2Fs00xxxxxxx3trial%24s00xxxxxxx3-OrionContent%2FProductClassificationML∨igional-url=index.html&sap-ui-appCacheBuster=..%2F&sap-ui-xx-componentPreload=off:1 Failed to load https://sandbox.api.sap.com/ml/imgclassifier/inference_sync: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://webidetesting9605175-s00xxxxxxx3trial.dispatcher.hanatrial.ondemand.com' is therefore not allowed access. The response had HTTP status code 404.


Any suggestion?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers