Skip to content

Commit

Permalink
Fixes bug where methodName would not be included in the response event (
Browse files Browse the repository at this point in the history
  • Loading branch information
levinunnink authored and jsdevel committed Aug 8, 2019
1 parent aee79a8 commit 47dcede
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ export class Server extends EventEmitter {
this.emit('headers', headers, pair.methodName);
}

methodName = pair.methodName;

this._executeMethod({
serviceName: serviceName,
portName: portName,
Expand Down
11 changes: 11 additions & 0 deletions test/server-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 47dcede

Please sign in to comment.