wampy.js
wampy.js copied to clipboard
not support route with parameter?
I implemented a callee method with parameter routing with WampSharp like this:
[WampProcedure("com.arguments.add2.{0}")]
public Task< int> AddAsync2(int a, int b)
{
Console.WriteLine("add");
return Task.FromResult( a + b);
}
and i'm trying to call it in js with
var ws = new Wampy('ws://127.0.0.1:8804/',
{
autoReconnect: false, realm: 'realm',
onConnect: () => {
console.log('Connected to Router!');
ws.call('com.arguments.add2.3', [3,4], /*When the callee started, it is 3*/
{
onSuccess: function (e) {
console.log('Reached success. Check Server side');
},
onError: function (e) {
console.log(e);
}
});
}
});
I get a error:"Topic URI doesn't meet requirements!".
And it's done with autobahn.js.
var connection = new autobahn.Connection({ url: 'ws://127.0.0.1:8804/', realm: 'realm' });
connection.onopen = function (session) {
function onevent(args) {
console.log("Event:", args[0]);
}
session.call('com.arguments.add2.3', [5,6]).then(
function (res) {
console.log("Result:", res);
}
);
};
connection.open();
What shall I do?
Hi @zhusheping ! Can you show full code? What version of wampy do you use? I can't reproduce it on latest version (6.2.2)
zip 1.run the project "wampHost". 2.run a callee of project "wampCallee". 3.open index.html in project "wampCaller",the result 11 was logged. 4.open default.html in project "wampCaller","Topic URI doesn't meet requirements!" logged.
Seems this is outdated... So closing for now. Please feel free to reopen if needed in case it is reproducible on the latest versions