[英]Failure connecting to S/4 Hana via Cloud SDK
I'm following the OData tutorial at https://blogs.sap.com/2017/05/21/step-4-with-sap-s4hana-cloud-sdk-calling-an-odata-service/comment-page-1/ and I'm getting an error when I try to retrieve business partners using DefaultBusinessPartnerService
. 我正在通过以下网址访问OData教程: https: //blogs.sap.com/2017/05/21/step-4-with-sap-s4hana-cloud-sdk-calling-an-odata-service/comment-page- 1 /并且当我尝试使用
DefaultBusinessPartnerService
检索业务伙伴时遇到错误。
The relevant piece of code is: 相关的代码段是:
DefaultBusinessPartnerService businessPartnerService = new DefaultBusinessPartnerService();
System.err.println("criated default business partner");
List<BusinessPartner> partners = businessPartnerService
.getAllBusinessPartner()
.select(BusinessPartner.BUSINESS_PARTNER,
BusinessPartner.LAST_NAME,
BusinessPartner.FIRST_NAME)
//.filter(BusinessPartner.BUSINESS_PARTNER_CATEGORY.eq(CATEGORY_VENDOR))
.orderBy(BusinessPartner.LAST_NAME, Order.ASC)
.execute(new ErpEndpoint(new ErpConfigContext()));
response.setContentType("application/json");
response.getWriter().write(new Gson().toJson(partners));
My ErpQueryEndpoint
configuration is as follows: 我的
ErpQueryEndpoint
配置如下:
#Mon May 14 15:27:09 BRT 2018
URL=https\://host\:port
Name=ErpQueryEndpoint
TrustAll=TRUE
Type=HTTP
Password=Password
Authentication=BasicAuthentication
User=Username
Where host
, port
, Username
and Password
have been replaced by the correct values. 其中
host
, port
, Username
和Password
已替换为正确的值。
When I query http://localhost:8080/s4integration-application/businesspartners
I get the following error: 当我查询
http://localhost:8080/s4integration-application/businesspartners
,出现以下错误:
The endpoint responded with HTTP error code 403.
No service found for namespace , name API_BUSINESS_PARTNER, version 0001
Full error message:
{
"error": {
"code": "/IWFND/MED/170",
"message": {
"lang": "en",
"value": "No service found for namespace , name API_BUSINESS_PARTNER, version 0001"
},
"innererror": {
"application": {
"component_id": "",
"service_namespace": "/SAP/",
"service_id": "API_BUSINESS_PARTNER",
"service_version": "0001"
},
"transactionid": "C83CB3D2A1420000E005AF97B0836AD5",
"timestamp": "20180514182746.3576100",
"Error_Resolution": {
"SAP_Transaction": "Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system (System Alias ) and search for entries with the timestamp above for more details",
"SAP_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"
},
"errordetails": []
}
}
}
It seems that the endpoint is not configured on the SAP system (it's an S/4 Hana system). 似乎端点未在SAP系统上配置(这是S / 4 Hana系统)。 I'm not sure if I have to add something else to the
URL
besides the host and port or if there is some other configuration that has to be done on the SAP system. 我不确定是否必须在主机和端口之外向
URL
添加其他内容,或者是否必须在SAP系统上进行其他配置。
可以从以下位置找到从SAP S / 4HANA后端激活OData API的说明:help.sap.com/viewer/cdc25c83b63e482586b31b8acd49cf2f/1610%20003 / ...只需忽略Fiori应用程序的概念即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.