I think I've got things working using the undocumented "handle"
method. For reference, here's what I'm using, dropped into xhr.html on
"remote" server. Let me know if you see anything that looks incorrect.
var remote = new easyXDM.Rpc({
local: "name.html"
}, {
handle : function(data, _send)
{
var used = false, success, error;
if (
data.id) {
success = function(result){
if (used) {
return;
}
used = true;
_send(result);
};
error = function(message){
if (used) {
return;
}
used = true;
var msg = {
id:
data.id,
error: {
code: -32099,
message: "Application error: " + message
}
};
if (typeof message == "object" && "data" in message)
{
msg.error.data = message.data;
}
_send(msg);
};
}
else {
success = error = emptyFn;
}
easyXDM.ajax({
url : "MYWEBSERVICEENDPOINT",
method: "POST",
data: easyXDM.getJSONObject().stringify(data),
type: "json",
success: success,
error: error
});
}
}
});
On Sep 1, 12:22 pm, Øyvind Sean Kinsey <
oyv...@kinsey.no> wrote:
> Did you find an approach here that fits with your architecture? (There a
> multiple ways of doing this).
>
> Øyvind Sean Kinsey
> oyv...@kinsey.nohttp://
kinsey.no/blog/index.php/about/