Hi,

qx.io.remote.Request has not been tested with cross-origin resource sharing.

However, as long as you set the property crossDomain to false (which is the 
default), qooxdoo should pick the XmlHttp transport. That being said, it sounds 
like a server configuration issue. At least, the error message you pasted is 
not generated by qooxdoo.

However, I don't see anything obviously wrong with your config.

Did you debug the request sent and check if it contains an Origin header? 
According to the Mozilla Docs [1], the XmlHttpRequest object should handle this 
for you automatically but maybe Chrome does require some tweaking? Have you 
checked with Firefox?

Tristan

[1] https://developer.mozilla.org/En/HTTP_Access_Control

Am 04.01.2011 um 04:14 schrieb Jihed Amine Maaref:

Hi,

I have a Java REST webservice deployed on tomcat 
(http://localhost:8080/myrestfulapp/aservice/).

In my qooxdoo app, I try to send a POST request using qx.io.remote.Request.
I built the application and deployed it on an apache HTTP server (named 
http://myserver.org<http://myserver.org/>).
When I try to send the request, I get this error in javascript console of my 
web browser (Chrome on linux):
Origin http//myserver.org<http://myserver.org/> is not allowed by 
Access-Control-Allow-Origin

I added crossdomain.xml in tomcat's ROOT webapp, in /var/www and in my http 
server's root directory.
I enabled apache headers (a2enmod headers) and I added 
Access-Control-Allow-Origin "*" in my server's configuration file.

here is my qooxdoo function sending the request:

    envoyer : function(id, nom, prenom, poste)
    {
      var url = "http://localhost:8080/helloworld/enregistrer";;
      var donnees = "{ \"id\":" + id + ", \"nom\":\"" + nom + "\", 
\"prenom\":\"" + prenom + "\", \"poste\":\""+poste +"\" }";
      alert(donnees);
      var req = new qx.io.remote.Request(url, "POST", "application/json");
      req.setData(donnees);

      req.addListener("completed", function(e) {
                alert(e.getContent());
      });
      req.send();
    }

and here is the myserver.org<http://myserver.org/> configuration file:
<VirtualHost *:80>
    ServerAdmin webmas...@localhost
    serverName myserver.org<http://myserver.org/>

    DocumentRoot /home/jihedamine/HttpServer
    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    <Directory /home/jihedamine/HttpServer/>
        Header set Access-Control-Allow-Origin "*"
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

So how could I enable sending cross origin http requests from a qooxdoo app to 
a java backend deployed on tomcat ?
<ATT00001..txt><ATT00002..txt>

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to