Ice for JavaScript : to get interface from other interface

in Help Center
Hi, I'm new in Ice for JavaScript and I have a question. I have the following file .ice :
I'm attempting to use the "getMasterString" function which belongs to the "Master" interface from other interface ("Printer").
I can retrieve the "Master" but I can't retrieve the string returned by the function "getMasterString".
In the Client.js (after creating the session), I do :
And the result of running the client is :
I've attached the files (client, server, config server, config glacier, and .ice).
#pragma once module Demo { struct Info{ string str = "String in struct Info"; }; interface Master{ string getMasterString(); }; interface Printer{ void printString(string s); string getTest(); Info getInfo(); Master* getMaster(); }; };
I'm attempting to use the "getMasterString" function which belongs to the "Master" interface from other interface ("Printer").
I can retrieve the "Master" but I can't retrieve the string returned by the function "getMasterString".
In the Client.js (after creating the session), I do :
function runWithSession(router, session) { var proxy = communicator.stringToProxy("printer -t:tcp -h localhost -p 10000"); var printer = Demo.PrinterPrx.uncheckedCast(proxy) Ice.Promise.all( printer.getMaster().then( function(result){ masterPrx = Demo.MasterPrx.uncheckedCast(result); //console.log(masterPrx.getMasterString().toString()); masterPrx.getMasterString().then( function(str){ console.log(str); }, function(ex){ console.log("fail : "+ex); } ) //return result; } )/*.then( function(master){ return master.getMasterString().then( function(str){ console.log("str : "+str); }, function(ex){ console.log(ex); } ) } )*/ ); }
And the result of running the client is :
This Client accepts any user-id / password combination. user id : user password : pass fail : Ice::CommunicatorDestroyedException ice_cause: "undefined"
I've attached the files (client, server, config server, config glacier, and .ice).
0
Comments
You need something like:
The call to getMaster returns a MasterPrx value.
Mark