Hi,
first of all, sorry for the late answer. Looks like your message took a
while to reach the list.
Setting the request's crossDomain property to true means the Script
transport (qx.io.remote.transport.Script) will be used. In that case,
the request will have a parameter "_ScriptTransport_id". Your response
needs to call the static method
qx.io.remote.transport.Script._requestFinished with this ID as the first
parameter and the actual response content as the second parameter:
from cgi import parse_qs
def application(environ, start_response):
parameters = parse_qs(environ.get('QUERY_STRING', ''))
if "_ScriptTransport_id" in parameters:
st_id = parameters['_ScriptTransport_id'][0]
status = '200 OK'
output = 'qx.io.remote.transport.Script._requestFinished(%s, "MY
OUTPUT TEST");' %st_id
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return output
This is currently only described in the package documentation for
qx.io.remote, but not in the class documentation for
qx.io.remote.transport.Script, which is probably where you were looking.
I'll open a bug so this information will be duplicated.
Regards,
Daniel
daemonk schrieb:
> I am using apache2 with mod_wsgi for running my python scripts. I wrote a
> simple python script (test.wsgi) that'll just output a string:
>
> def application(environ, start_response):
> status = '200 OK'
> output = 'MY OUTPUT TEST'
>
> response_headers = [('Content-type', 'text/plain'),
> ('Content-Length', str(len(output)))]
> start_response(status, response_headers)
>
> return output
>
> When I open this script with my browser, I see the 'MY OUTPUT TEST' string
> on my browser string. So the python script works.
>
> Then in the application.js:
> req = new qx.io.remote.Request("http://localhost/test.wsgi", "GET",
> "text/plain");
> req.setCrossDomain(true);
>
> req.addListener("completed", function(e) {
> alert(req.getContent());
> });
>
> and added a button that'll execute req.send() on click.
>
> I ran the webpage and clicked on the button. I get this error:
> 015643 qx.io.remote.RequestQueue[21]: Timeout: transport 23
> 015645 qx.io.remote.RequestQueue[21]: 5107ms > 5000ms
> 015647 qx.io.remote.Exchange[23]: Timeout: implementation 24
>
> What am I doing wrong?
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel