update soap definition

This commit is contained in:
etuxxyl 2016-03-15 14:34:20 +08:00
parent 81ebfb3d08
commit 40f2dd30cf
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,7 @@
/// <reference path="soap.d.ts" />
import * as soap from 'soap';
import * as events from 'events';
const url = 'http://example.com/wsdl?wsdl';
const wsdlOptions = { name: 'value' };
@ -15,5 +16,8 @@ soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) {
client['create']({ name: 'value' }, function(err, result) {
// result is an object
}, {});
client.on('request', function(obj: any) {
//obj is an object
});
});

6
soap/soap.d.ts vendored
View File

@ -3,11 +3,15 @@
// Definitions by: Nicole Wang <https://github.com/nicoleWjie>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../node/node.d.ts' />
declare module 'soap' {
import * as events from 'events';
class WSSecurity {
constructor(username: string, password: string, options: any);
}
interface Client {
interface Client extends events.EventEmitter {
setSecurity(s: WSSecurity): void;
[method: string]: (args: any, fn: (err: any, result: any) => void, options?: any) => void;
addSoapHeader(headJSON: any): void;