Skip to Content

calling external url from sapui5 app

Hi Everyone,

I am working on sapui5 custom application. Here I have a requirement to post on url which is at different domain. I need to pass credentials to access this url. How do i achieve this.?

I tried using jsonP and callback:? however I am getting '401' error. NO allow-access-domain error in chrome browser.

i tried $.post{url,{ }}

Let me know if more information is required..

thanks

Fehmina.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 18 at 01:12 PM

    Hello Fehmina,

    If your file is on a different domain (or IP address) than your web-application, the browser will not allow direct XMLHttpRequests unless the Service returns CORS-headers - see https://en.wikipedia.org/wiki/Cross-origin_resource_sharing. This is a browser-security-feature and can only be circumvented by either sending the CORS-headers or using a proxy on the same domain as the web-application.

    The file needs to be hosted in the same domain as the UI5 application. This can be accomplished in one of the following ways:

    • Host the files on the same system as the UI5 app
    • Use the SAP Web Dispatcher as an access point for both the app and the theme
    • Use a third-party proxy as an access point for the same

    Best regards,

    Désirée

    Add comment
    10|10000 characters needed characters exceeded