Sorry for the long post, but I need some help and wanted to give as much
information as possible:

1.) It seems I can't use 'POST' when trying to get data across domains
(rpc.setCrossDomain(true)). Is this a bug or is this SOP?  Is there any
other way in Qooxdoo to get data across domains using POST?  (It seems that
doesn't even work in the local network - but only on the same IP-Adress)

2.) The second thing I couldn't figure out is, how I can put additional data
into the body of the request? Instead of everything encoded in the URL. (See
the TCP-Flow results at the end of this post:
-> curl: works -> and has the test-method in the body.
-> qooxdoo: doesn't work -> and has everything in the URL

RPC - Test:
----------

var rpc = new qx.io.remote.Rpc();
    rpc.setTimeout(10000);
    rpc.setUrl("http://192.168.1.65/control";);
    rpc.setServiceName("test.anymethod");
    rpc.setCrossDomain(true);

    // call a remote procedure -- takes no arguments, returns a string
    var that = this;
    this.RpcRunning = rpc.callAsync(
      function(result, ex, id)
      {
        that.RpcRunning = null;
        if (ex == null) {
            alert(result);
        } else {
            alert("Async(" + id + ") exception: " + ex);
        }
      },
      "test.anyOtherMethod");


Request-Test:
------------

var vUrl = "http://192.168.1.65/control";

var req = new qx.io.remote.Request(vUrl, "POST", "text/plain");
        req.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
        req.setCrossDomain(true);

         var requestObject =
              {
                "method"  : "test.anymethod",
                "id"      : 1
              };
       
 req.setData(qx.util.Json.stringify(requestObject));

        req.addListener("completed", function(e) {
            var remoteData = e.getContent();
            alert("Data received: " + remoteData);
        });


        var failfunc = function(e, g, f) {
            alert("request failed: " + e + " => " + f);
        }

        req.addListener("failed", failfunc, this, true, "failed");
        req.addListener("timeout", failfunc, this, true, "timeout");
        req.addListener("aborted", failfunc, this, true, "aborted");

        req.send();



TCP-Flow
----------

1. curl -d request:
-------------------

192.168.001.068.58345-192.168.001.065.00080: POST /control HTTP/1.1

User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3
OpenSSL/0.9.7l zlib/1.2.3

Host: 192.168.1.65

Accept: */*

Content-Length: 50

Content-Type: application/x-www-form-urlencoded

{ "method": "test.anymethod", "id": 1 }




2. Qooxdoo request:
-------------------

192.168.001.068.59988-192.168.001.065.00080: GET
/control?_ScriptTransport_id=14&nocache=1233936097657&cmd=tree&file=load&_Sc
riptTransport_data=%7B%22method%22%3A%22test.anymethod%22%2C%22id%22%3A1%7D
HTTP/1.1

Host: 192.168.1.65

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; de; rv:1.9.0.6)
Gecko/2009011912 Firefox/3.0.6

Accept: */*

Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive


If you read until here: Thanks for listening ;-)

andy







------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to