-
|
Hello, I wanted to write a simple example of how Dynamic Invocation works in ICE, but the client I wrote in JS doesn't work. When it wants to run it, it just says "TypeError: proxy1.ice_invoke is not a function". I'm sure the ice package is installed, it's not a server-side error either, because a similar client I wrote in C# works fine. Do you have any ideas? I couldn't find any examples in the documentation with JS const DynamicInvocation = require("./dynamic-invocation.js").DynamicInvocation
const Ice = require("ice").Ice;
(async () => {
const communicator = Ice.initialize()
const obj1 = await communicator.stringToProxy("add/add:tcp -h 127.0.0.2 -p 10000");
const proxy1 = await DynamicInvocation.OperationsPrx.uncheckedCast(obj1);
if (!(proxy1)) {
console.error("Cast failed");
return;
}
let outStream1 = new Ice.OutputStream(communicator);
outStream1.startEncapsulation();
outStream1.writeInt(3);
outStream1.writeInt(7);
outStream1.endEncapsulation();
let inEncaps1 = outStream1.finished();
let resultAdd = await proxy1.ice_invoke("add", Ice.OperationMode.Normal, inEncaps1)
let inStream = new Ice.InputStream(communicator, resultAdd);
inStream.startEncapsulation();
let result1 = inStream.readInt();
inStream.endEncapsulation();
console.log("3 + 7 =", result1)
await communicator.destroy();
})(); |
Beta Was this translation helpful? Give feedback.
Answered by
pepone
Apr 21, 2025
Replies: 1 comment
-
|
Hi @KLR2002 Ice for JavaScript doesn't provide a public ice_invoke API. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
bernardnormier
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @KLR2002
Ice for JavaScript doesn't provide a public ice_invoke API.