Permission denied to call method XMLHttpRequest.open

beren's picture

I'm moving thru the user guide and tutorials on the mashup server and hit up against a problem. The hello world client section says that I can include this:

<script type="text/javascript" src="http://yourip:7762/js/wso2/WSRequest.js"></script>
<script type="text/javascript" src="http://yourip:7762/services/helloworld?stub"></script>

in a page on a different web server and call my stuff, but I get this error:

Permission denied to call method XMLHttpRequest.open

From what I can tell this is a secutiry issue in Firefox and is not allowed. Is this right or is there some other issue with my code? Is there a workaround for this? It seems there are similar issues with IE and Safari too.

Beren

keith's picture

Its not an error on your part

Hi Beren,You are right. There is nothing wrong eith your code, you get this errorbecause of Mozillas security policy (You cannot post data only to thedomain that the page originated from). In IE there is a workaround (Youcan add this domain as a trusted site and it will work) but firefox doesnot allow any workaounds for this.Thanks,Keith.
jonathan.wso2.com's picture

Proxying

Note that when you invoke a stub inside a mashup, no security restrictions are enforced.  You could write a simple mashup, hosted at the same IP as your html, which passes the parameters to the remote service and passes along the results. The WSO2 ESB can be used to deploy such a proxy as well.  We are considering adding a simple zero-coding way to deploy a proxy on the Mashup Server, but we don't plan to have this as part of the 1.0 release feature set.
beren's picture

remote server

Yep - I get that...I was just looking at the tutorial that said to try this. Perhaps an update to the user guide would be a good idea to clarify this point. beren
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)