Andreas Junghans <[EMAIL PROTECTED]> writes:
> Sounds good, but I'd like to check first if it's easy to implement in Java
> (the problem I see is getting an additional query parameter from the URL
> when the request method is POST and the body is not form- encoded). It would
> be great if you could wait until monday (when I'm at my work machine again),
> so that I can confirm the URL-based approach doesn't cause problems in the
> Java implementation. It'll probably work just fine, but I want to make sure.
Andreas, I've been thinking about this. Although the specific case you
require, an instance id, is more specific than I feel belongs in the RPC
protocol, I can foresee a desire in various applications for being able to
send some generic "out of band" data from the client to the server. Here's an
alternative to passing the out-of-band data in the query string as we had
discussed doing with the instance id. Let me know what you think of this.
In Rpc.js:
/**
Data sent as "out of band" data in the request to the server. The format of
the data is opaque to RPC and may be recognized only by particular servers
It is up to the server to decide what to do with it: whether to ignore it,
handle it locally before calling the specified method, or pass it on to the
method. This server data is not sent to the server if it has been set to
'undefined'.
*/
qx.OO.addProperty({ name : "serverData", type : qx.constant.Type.OBJECT,
defaultValue : undefined });
/*
---------------------------------------------------------------------------
CORE METHODS
---------------------------------------------------------------------------
*/
qx.Proto._callInternal = function(args, async) {
var offset = 0;
var handler = args[0];
if (async) {
offset = 1;
}
var whichMethod = args[offset];
var argsArray = [];
for (var i = offset + 1; i < args.length; ++i) {
argsArray.push(args[i]);
}
var req = new qx.io.remote.RemoteRequest(this.getUrl(),
qx.constant.Net.METHOD_POST,
qx.constant.Mime.JSON);
var requestObject = {
"service": this.getServiceName(),
"method": whichMethod,
"id": req.getSequenceNumber(),
"params": argsArray
};
/* See if there's any out-of-band data to be sent to the server */
var serverData = this.getServerData();
if (serverData !== undefined) {
requestObject.server_data = serverData;
}
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel