Hi and thanks for the reply,
On Mon, Apr 27, 2009 at 5:39 PM, Derrell Lipman <
[email protected]> wrote:
> On Mon, Apr 27, 2009 at 11:31 AM, Jean-Noël Rivasseau
> <[email protected]>wrote:
>
>> Because of cross domain concerns, I am using the script transport
>> implementation to make server calls.
>
>
> Hi. This is a confusing statement. You are very correct that you should be
> concerned about allowing cross-domain calls to your server. Using the script
> transport, however, should not alleviate those concerns; rather, it's a way
> to say, "I don't care how insecure my server is going to be, I'm going to
> use cross-domain calls anyway."
>
> Caveat programmer. :-)
>
Yes, this was confusing, what I meant was:
I *have* to use cross domain calls (this is a requirement for the web-app),
thus I will resort to script transport. I actually do it like that in an old
version of the webapp that I am porting to Qx.
> It works fine, the server actually generates a JS script that gets executed
>> automatically. However I always have a warning like this each time I make a
>> server call:
>>
>> 11469ms qx.io.remote.RequestQueue[77]: Timeout: transport 79Native.js
>> (line 51)
>> 11500ms qx.io.remote.RequestQueue[77]: 5026ms > 5000msNative.js (line 51)
>> 11506ms qx.io.remote.Exchange[79]: Timeout: implementation 7a
>>
>> Why this timeout? How can I fix this (even if it is actually inoffensive)
>> ?
>>
>
> You shouldn't be getting the timeout, so that indicates that there's
> something wrong in your code. Please post a minimal example based on
> skeleton that shows what you're doing, and we may be able to tell you what's
> wrong.
>
Code:
var request = new qx.io.remote.Request(url, "GET",
"text/javascript"); // url is on another domain
request.setCrossDomain(true);
request.send();
Then the server just generates some JS code like
console.log("Hello World");
and I see that printed out in the console, so the code is called.
>
>
>> Another question, I am currently directly executing JS code that the
>> server generates. But if I were using serialized JSON, I am not too sure how
>> it could work given that IE does not fire an event on a <script> element
>> that gets loaded. How can you thus fire the "completed" event on such a
>> request?
>
>
> Script transport works by generating a call to a function:
>
> qx.io.remote.ScriptTransport._requestFinished(id, returnValue);
>
> This is a qooxdoo-specific enhancement that allows script transport to
> work, and requires agreement between the server and the client (qooxdoo)
> that the server will generate a response that calls this function. If your
> requirements are different, you'll likely need to derive your own transport
> class that knows how to deal with what your server wants to return.
>
Wait there... are you saying that in my generated JS code on the server I
should call explicitely this function?? eg:
console.log("Hello World");
// Do some other stuff there
qx.io.remote.transport.Script._requestFinished(id, returnValue);
That would make sense, but this should then be included in the
documentation, because there is nothing about this! This requires the server
to adhere to some conventions that are not at all described in the
documentation. What is id? What is returnValue?
Jean-Noel
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel