Don,

First, I think there's a misunderstanding about what crossDomain means -
it does not refer to a "domain" in the sense of a domain name or network
domain.  It is just used here to refer to a request to a different RPC
URL than the source page that makes the RPC request.  Since you
mentioned that the client is in the same network domain as the server,
it appears you may have misinterpreted this terminology.

Also, when you don't set crossDomain explicitly, it defaults to FALSE in
the implementation of qx.io.remote.RPC.  So, I would expect your
requests with it set to FALSE to have the same result as your requests
where you didn't set it at all.  In fact, they are the same between
these two scenarios in all except 4 of your tests in sections 2 & 5 -
where your request came from //server and your rpc call went
to //server.  Since you didn't show any code from your app or remote
service, it's not clear why these scenarios would be different - Setting
crossDomain to FALSE and not setting it at all should have yielded the
same result between #1, 2, 5, & 6.  Maybe you made a mistake somewhere
in your testing, and these scenarios really would have had the same
result if done as you stated.

In summary, when you access a page at one URL and request an RPC service
at a different URL, you are going to need to set crossDomain to true.
This is likely why eight of your requests came back as "Unknown Status
code", since these were all cases where the page URL did NOT match the
RPC URL and you essentially had crossDomain set to FALSE (half by
setting it to FALSE and half by leaving it at the default of FALSE).

Secondly, you didn't mention how your RPC server is configured.  In the
case of RPC-PHP, the RPC server is configured by default to only allow
non-cross-domain requests.  If you haven't checked this setting, then
this would explain why your requests with crossDomain set to TRUE would
fail.  The server is likely ignoring the crossDomain request because
it's set to not allow them.  Also note that setting crossDomain to TRUE
will force a different request mode, as pointed out in the API docs for
qx.io.remote.RPC, specifically using scriptTransport mode.  So, even if
you have set the RPC server to allow crossDomain requests, it is
possible that the specific request you are implementing cannot be done
via RPC with crossDomain set to TRUE - it really depends on what you are
trying to send and receive in your specific implementation.

Anyway, I hope some of what I've said here provides some additional
insight for you.  Derrell, please correct anything I might have stated
incorrectly here, as you're the expert in this area.

Regards,

   Gene

On Fri, 2009-10-23 at 15:28 -0400, Don Lee wrote:

> I am using qooxdoo-0.8.3, along with web2py as my backend.  My web
> server and client are on the same network/domain. I have observer that
> depending on the URL provided to the RPC object and whether I set
> crossDomain, I get weird behavior even when running the software from
> the web server itself.  I have found the following:
> 
> web server / json-rpc service host = server.domain.com / server
> client resolves to client.domain.com (they are both in the same domain)
> 
> 1.
> -------
> setting
> var rpc = new 
> qx.io.remote.Rpc("http://server.domain.com/app/controller/call/jsonrpc";);
> rpc.setCrossDomain(false);
> 
> - connecting to http://server/qxapp/source from the client produces
> "Transport error 0: Unknown status code"
> - connecting to http://server/qxapp/source from the server produces
> "Transport error 0: Unknown status code"
> - connecting to http://server.domain.com/qxapp/source from the client
> produces a positive response from the service
> - connecting to http://server.domain.com/qxapp/source from the server
> produces a positive response from the service
> 
> 
> 2.
> -------
> setting
> var rpc = new qx.io.remote.Rpc("http://server/app/controller/call/jsonrpc";);
> rpc.setCrossDomain(false);
> 
> - connecting to http://server/qxapp/source from the client produces
> "Local error 1: Local time-out expired"
> - connecting to http://server/qxapp/source from the server produces
> "Local error 1: Local time-out expired"
> - connecting to http://server.domain.com/qxapp/source from the client
> produces "Transport error 0: Unknown status code"
> - connecting to http://server.domain.com/qxapp/source from the server
> produces "Transport error 0: Unknown status code"
> 
> 
> 3.
> -------
> setting
> var rpc = new 
> qx.io.remote.Rpc("http://server.domain.com/app/controller/call/jsonrpc";);
> rpc.setCrossDomain(true);
> 
> - connecting to http://server/qxapp/source from the client produces
> "Local error 1: Local time-out expired"
> - connecting to http://server/qxapp/source from the server produces
> "Local error 1: Local time-out expired"
> - connecting to http://server.domain.com/qxapp/source from the client
> produces "Local error 1: Local time-out expired"
> - connecting to http://server.domain.com/qxapp/source from the server
> produces "Local error 1: Local time-out expired"
> 
> 
> 
> 4.
> -------
> setting
> var rpc = new qx.io.remote.Rpc("http://server/app/controller/call/jsonrpc";);
> rpc.setCrossDomain(true);
> 
> - connecting to http://server/qxapp/source from the client produces
> "Local error 1: Local time-out expired"
> - connecting to http://server/qxapp/source from the server produces
> "Local error 1: Local time-out expired"
> - connecting to http://server.domain.com/qxapp/source from the client
> produces "Local error 1: Local time-out expired"
> - connecting to http://server.domain.com/qxapp/source from the server
> produces "Local error 1: Local time-out expired"
> 
> 
> 5.
> -------
> setting
> var rpc = new qx.io.remote.Rpc("http://server/app/controller/call/jsonrpc";);
> ** do not call rpc.setCrossDomain()
> 
> - connecting to http://server/qxapp/source from the client produces a
> positive response from the service
> - connecting to http://server/qxapp/source from the server produces a
> positive response from the service
> - connecting to http://server.domain.com/qxapp/source from the client
> produces "Transport error 0: Unknown status code"
> - connecting to http://server.domain.com/qxapp/source from the server
> produces "Transport error 0: Unknown status code"
> 
> 
> 6.
> -------
> setting
> var rpc = new 
> qx.io.remote.Rpc("http://server.domain.com/app/controller/call/jsonrpc";);
> ** do not call rpc.setCrossDomain()
> 
> - connecting to http://server/qxapp/source from the client produces
> "Transport error 0: Unknown status code"
> - connecting to http://server/qxapp/source from the server produces
> "Transport error 0: Unknown status code"
> - connecting to http://server.domain.com/qxapp/source from the client
> produces a positive response from the service
> - connecting to http://server.domain.com/qxapp/source from the server
> produces a positive response from the service
> 
> 
> I would think that at the very least, running the code from the server
> would always produce positive results.  That does not appear to be the
> case, at least in my setup.  Can anyone shed some light?
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to