diff --git a/src/server.ts b/src/server.ts index 1479a81f1..6b3e0141e 100644 --- a/src/server.ts +++ b/src/server.ts @@ -372,6 +372,8 @@ export class Server extends EventEmitter { this.emit('headers', headers, pair.methodName); } + methodName = pair.methodName; + this._executeMethod({ serviceName: serviceName, portName: portName, diff --git a/test/server-test.js b/test/server-test.js index 67225dab6..10edb098c 100644 --- a/test/server-test.js +++ b/test/server-test.js @@ -379,6 +379,17 @@ describe('SOAP Server', function() { }); }); + it('should emit \'response\' event', function(done) { + test.soapServer.on('response', function requestManager(request, methodName) { + assert.equal(methodName, 'GetLastTradePrice'); + done(); + }); + soap.createClient(test.baseUrl + '/stockquote?wsdl', function(err, client) { + assert.ifError(err); + client.GetLastTradePrice({ tickerSymbol: 'AAPL'}, function() {}); + }); + }); + it('should emit \'headers\' event', function(done) { test.soapServer.on('headers', function headersManager(headers, methodName) { assert.equal(methodName, 'GetLastTradePrice');