HANA XS JS未能获取错误" response.body未定义"

2020-09-08 02:19发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)嗨 我正在使用HCP试用帐户从...

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

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


我正在使用HCP试用帐户从XS Engine调用服务,但出现以下错误,请帮助。

错误消息:

 response.body未定义

服务

 https://services.odata.org/V3/(S(clbuvpwqszxztk5zr1rv3q0r))/OData/OData.svc/Products 

HttpDest

 host =" services.odata.org";
 端口= 80;
 description ="产品信息";
 useSSL = false;
 pathPrefix ="/V3/(S(h3xfygdy0bmj1yotsbwmspjz))/OData/OData.svc";
 authType =无;
 useProxy = true;
 proxyHost ="代理审判";
 proxyPort = 8080;
 超时= 3000;
 

XSJS文件

 function getData(){
     var destinationPackage =" Demo1";
     var destinationName =" apicall";
 尝试{
 var dest = $ .net.http.readDestination(destinationPackage,destinationName);
 var client = new $ .net.http.Client();
 var req = new $ .net.http.Request($。net.http.GET,"/img/Products");
 client.request(req,dest);

 var response = client.getResponse();
 $ .response.contentType =" application/json";
 $ .response.setBody(response.body.asString());
 $ .response.status = $ .net.http.OK;
 client.close();
     }抓住(e){
 $ .response.contentType ="文本/纯文本";
 $ .response.setBody(e.message);
     }
 }
 getData();
 
3条回答
2020-09-08 03:01

我已经更改了HttpDest文件

 description ="产品信息";
 host =" services.odata.org";
 端口= 80;
 pathPrefix ="/V3/(S(h3xfygdy0bmj1yotsbwmspjz))/OData/OData.svc";
 proxyHost ="代理";
 proxyPort = 8080;
 authType =无;
 useSSL = true;
 超时= 0;
 sslHostCheck = true;
 sslAuth =客户端;
 

现在遇到错误

 HttpClient.request:请求失败:发生内部错误"无法将请求发送到套接字... rc = -1" 

一周热门 更多>