天天看點

SAP WebIDE一個和Destination相關的問題 - OData下拉菜單裡的Destination從哪裡來的

我今天做開發遇到一個問題:

我有trial和正式的SAP Cloud Platform賬号各一個:

其中trial賬号的webIDE連接配接到productive的CloudFoundry:

productive賬号的WebIDE也連接配接到productive的CloudFoundry:

我發現在我建立OData服務時,從Service url的下拉菜單裡,選擇不到我在SAP雲平台裡建立的Destination.

怎麼感覺trial WebIDE取的Destination來自trial neo環境建立的?

而productive的WebIDE,system下拉菜單裡的Destination也來自productive Neo環境的Destination.

似乎CloudFoundry環境的Destination根本沒有被考慮。

再檢查我使用的webIDE的url.

trial:

https://webidecp-i042416trial.dispatcher.hanatrial.ondemand.com/

後來發現了一個github issue:

https://github.com/SAPDocuments/Tutorials/issues/3398

得知如果在SAP WebIDE裡建立UI5應用,需要用Destination連結第三方服務時,需要在Neo環境裡建立Destination,而不是在CloudFoundry環境裡。

為了驗證,我再次在Neo環境裡建立一個Destination:

然後果然在WebIDE裡看到了這個建立于Neo環境的Destination.

WebIDE Preferences裡維護的CloudFoundry endpoint隻是開發好的UI5應用部署的目的地。

那麼問題又來了,既然這個UI5應用最終部署在SAP雲平台的CloudFoundry環境下,如果CloudFoundry環境沒有對應的Destination,運作時的表現是怎樣的?

經過我實際測試,發現取不到OData服務的metadata,報500 Internal Server Error的錯誤。

于是我把Neo環境裡建立的Destination導出,再倒入到CloudFoundry環境,這次發現OData metadata終于能夠成功傳回了:

本文來自雲栖社群合作夥伴“汪子熙”,了解相關資訊可以關注微信公衆号"汪子熙"。

繼續閱讀