Hi ,
I am facing authorization error while trying to access SAP Gateway service.
Please see the below code which i am using to access.
var xhr = Ti.Network.createHTTPClient(); xhr.open("GET","http://Gateway server/sap/opu/sdata/sap/ZBANKRFCMADHUR/z_bank_rfc_madhurCollection?sap-client=100&$format=xml"); var authstr = 'Basic ' +Titanium.Utils.base64encode('ACC10686625'+':'+'bsvl@27'); xhr.setRequestHeader('Authorization',authstr); xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"); xhr.send(); xhr.onload = function()
While using the above code , i am getting the below error.
[ERROR][TiHttpClient( 265)] (TiHttpClient-2) [1,2639] HTTP Error (org.apache.http.client.HttpResponseException): Unauthorized [ERROR][TiHttpClient( 265)] org.apache.http.client.HttpResponseException: Unauthorized [ERROR][TiHttpClient( 265)] at ti.modules.titanium.network.TiHTTPClient$LocalResponseHandler.handleResponse(TiHTTPClient.java:230) [ERROR][TiHttpClient( 265)] at ti.modules.titanium.network.TiHTTPClient$LocalResponseHandler.handleResponse(TiHTTPClient.java:189) [ERROR][TiHttpClient( 265)] at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:657) [ERROR][TiHttpClient( 265)] at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:637) [ERROR][TiHttpClient( 265)] at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1142) [ERROR][TiHttpClient( 265)] at java.lang.Thread.run(Thread.java:1096) [INFO][TiHttpClient( 265)] (TiHttpClient-2) [3,2642] Sending error Unauthorized
Please check and help.
Regards, Madhur
Your Answer
Think you can help? Login to answer this question!