sapui5应用中的SAP Machine Learning图像分类器服务不起作用

2020-09-18 19:45发布

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


您好,我已经按照一些教程将ml imageclassifier服务与通过Web ide开发的sapui5应用程序一起使用。 我尝试直接在SAP API Business Hub上使用服务( https://api.sap.com/shell/discover/contentpackage/SAPLeonardoMLFunctionalServices/api/image_classification_api?section=OVERVIEW ),一切正常,然后我获得了API密钥并在代码中使用了它 ,但没有一个应用程序在工作。 我使用以下教程(下面的链接),但出现此错误:


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

错误(控制台):无法加载资源:服务器的状态为400(错误请求),Extended_runnable_file.html:1无法加载 https://sandbox.api.sap.com/ml/imageclassifier/inference_sync :没有" Access-Control-Allow-Origin"标头 存在于请求的资源上。 来源' https://webidetesting9605175-s00xxxxxxx3trial.dispatcher.hanatrial.ondemand.com '因此不允许访问。 响应的HTTP状态代码为400。Main.controller.js?eval:58 library.css加载资源失败:服务器响应的状态为404(未找到)

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

错误(对话框):错误400:此服务至少需要1个文件。 请将您的文件放入POST请求的"文件"字段中

错误(控制台):无法加载资源:服务器以400(错误请求)的状态进行响应-无法加载资源:服务器以404(未找到)的状态进行响应

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

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

错误(控制台):无法加载资源:服务器以状态404(未找到)进行了响应Extended_runnable_file.html?hc_orionpath =%2Fs00xxxxxxx3trial%24s00xxxxxxx3-OrionContent%2FProductClassificationML∨igional-url= index.html&sap-ui- appCacheBuster = ..%2F&sap-ui-xx-componentPreload = off:1无法加载 https://sandbox.api.sap.com/ml/imgclassifier/inference_sync :对预检请求的响应未通过访问控制检查:不存在" Access-Control-Allow-Origin"标头 在请求的资源上。 来源' https://webidetesting9605175-s00xxxxxxx3trial.dispatcher.hanatrial.ondemand.com '因此不允许访问。 响应的HTTP状态代码为404。


有什么建议吗?

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


您好,我已经按照一些教程将ml imageclassifier服务与通过Web ide开发的sapui5应用程序一起使用。 我尝试直接在SAP API Business Hub上使用服务( https://api.sap.com/shell/discover/contentpackage/SAPLeonardoMLFunctionalServices/api/image_classification_api?section=OVERVIEW ),一切正常,然后我获得了API密钥并在代码中使用了它 ,但没有一个应用程序在工作。 我使用以下教程(下面的链接),但出现此错误:


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

错误(控制台):无法加载资源:服务器的状态为400(错误请求),Extended_runnable_file.html:1无法加载 https://sandbox.api.sap.com/ml/imageclassifier/inference_sync :没有" Access-Control-Allow-Origin"标头 存在于请求的资源上。 来源' https://webidetesting9605175-s00xxxxxxx3trial.dispatcher.hanatrial.ondemand.com '因此不允许访问。 响应的HTTP状态代码为400。Main.controller.js?eval:58 library.css加载资源失败:服务器响应的状态为404(未找到)

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

错误(对话框):错误400:此服务至少需要1个文件。 请将您的文件放入POST请求的"文件"字段中

错误(控制台):无法加载资源:服务器以400(错误请求)的状态进行响应-无法加载资源:服务器以404(未找到)的状态进行响应

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

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

错误(控制台):无法加载资源:服务器以状态404(未找到)进行了响应Extended_runnable_file.html?hc_orionpath =%2Fs00xxxxxxx3trial%24s00xxxxxxx3-OrionContent%2FProductClassificationML∨igional-url= index.html&sap-ui- appCacheBuster = ..%2F&sap-ui-xx-componentPreload = off:1无法加载 https://sandbox.api.sap.com/ml/imgclassifier/inference_sync :对预检请求的响应未通过访问控制检查:不存在" Access-Control-Allow-Origin"标头 在请求的资源上。 来源' https://webidetesting9605175-s00xxxxxxx3trial.dispatcher.hanatrial.ondemand.com '因此不允许访问。 响应的HTTP状态代码为404。


有什么建议吗?

付费偷看设置
发送
1条回答
shere_lin
1楼-- · 2020-09-18 20:33

您好 Eugenio Giunta

我很惊讶您通过 https://www遇到这些错误 .sap.com/developer/tutorials/ml-fs-sapui5-img-classification.html

您可以打开浏览器开发人员工具(按F12键)并检查请求标头,然后将其共享吗?

FileUploader通常在需要时会处理所有管道。 除非您使用的是本教程提供的Ajax或XHR模式?

致谢

一周热门 更多>