r8070: a (as yet not working) example of how rpc calls might be made from js scripts
authorAndrew Tridgell <tridge@samba.org>
Sat, 2 Jul 2005 05:22:12 +0000 (05:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:19:05 +0000 (13:19 -0500)
testprogs/ejs/echo.js [new file with mode: 0644]

diff --git a/testprogs/ejs/echo.js b/testprogs/ejs/echo.js
new file mode 100644 (file)
index 0000000..6d01f69
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+       demonstrate access to rpc calls from ejs
+*/     
+
+function irpcObj()
+{
+       var o = new Object();
+       o.in = new Object();
+       return o;
+}
+
+function test_AddOne()
+{
+       var status;
+       var conn = new Object();
+       var io = irpcObj();
+
+       status = rpc_connect(conn, "ncacn_ip_tcp:localhost", "rpcecho");
+       printVars(status);
+       printVars(conn);
+
+       io.in.in_data = 3;
+       status = rpc_call(conn, "echo_AddOne", io);
+       printVars(status);
+       printVars(io);
+}
+
+
+print("Starting\n");
+
+test_AddOne();
+
+
+