Hi All,
I have a BSP application that inserts entries in to database tables in CRM system. Its URL is:
http://<domainname>:<port>/sap/bc/bsp/sap/yy_facebook/shoppingcart.htm
When I call this URL directly from a browser, it works. When I call it from a BSP page of a component, it works too. Below is how I am calling it using javascript:
function contactsearch(){
if(window.XMLHttpRequest){
request = new XMLHttpRequest();
try{
var url ="http://<domainname>:<port>/sap/bc/bsp/sap/yy_facebook/shoppingcart.htm?name=facebook";
request.open("GET",url,true);
request.send();
request.onreadystatechange = funcContactReadyStateChange;
}
catch(e){alert(e);};
}
}
function funcContactReadyStateChange(){
if(request.readyState == 4){
if(request.status == 200){
try{
alert("insertion done");
}
catch(e){};
}
}
}
A parameter "name" is appended to the URL. This will be picked and processed by the BSP application.
Now, if I call the same URL from an external website(in my case, I am calling it from a static HTML app of a facebook page), it doesn't work. Request.status is always 0 and sometimes I get the HTTP status 302 moved temporarily exception.
I modified the URL by adding logon parameters also. It is not recommended to add log on credentials directly in the URL due to obvious reasons, but this is just for testing purpose.
But still I get the same HTTP error. I also enabled HTTPS in my SAP systemd and used it instead of HTTP. Still no luck.
Please let me know what might be the issue or if I need to pass any other parameters while calling BSP page URL externally.
Regards,
Narendra