node-soap-server icon indicating copy to clipboard operation
node-soap-server copied to clipboard

Code in the example does not work - library throws an error

Open akimkelar opened this issue 5 years ago • 5 comments

Code in the example does not work - library throws an error

.../node_modules/soap-server/lib/soap-server.js:35 var args = matches[1].split(','); ^ TypeError: Cannot read property '1' of null at new SoapOperation (.../node_modules/soap-server/lib/soap-server.js:35:20) at SoapService.addOperation (.../node_modules/soap-server/lib/soap-server.js:121:26) at new SoapService (.../node_modules/soap-server/lib/soap-server.js:116:9) at SoapServer.addService (.../node_modules/soap-server/lib/soap-server.js:154:24) at Object. (.../index.js:10:30)

akimkelar avatar Oct 29 '19 10:10 akimkelar

This code is based on old and deprecated version of mediasoup, in the latest version you can do it much easier which makes this project irrelevant.

tan-tan-kanarek avatar Oct 29 '19 19:10 tan-tan-kanarek

still got the same error, any solution?

yhojann-cl avatar May 21 '22 19:05 yhojann-cl

I try solve this changing the pseudo class to a real class:

var soap = require('soap-server');

class Service {
	test1(argv1, argv2) {
		return `${argv1}${argv2}`;
	}
}

var soapServer = new soap.SoapServer();
var soapService = soapServer.addService('testService', new Service());

soapServer.listen(3000, '127.0.0.1');

But does not show the functions.

yhojann-cl avatar May 21 '22 19:05 yhojann-cl

Hi Yhojann,

When soap server parsers the operation from functions it expects a space between the function keyword and the open bracket. It might work if write your function like this:

MyTestService.prototype.test1 = function (myArg1, myArg2){
	return myArg1 + myArg2;
};

hdvianna avatar Oct 09 '22 15:10 hdvianna

Hi Yhojann, This project is obsolete and uses old version of mediasoup. I suggest using latest example from the official documentation, they show how to use ffmpeg.

tan-tan-kanarek avatar Oct 09 '22 20:10 tan-tan-kanarek