mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
[soap] Apply @aleung's SoapMethod fix
This commit is contained in:
Vendored
+5
-1
@@ -10,6 +10,10 @@ import * as events from 'events';
|
||||
interface Security {
|
||||
}
|
||||
|
||||
export interface SoapMethod {
|
||||
(args: any, callback: (err: any, result: any) => void, options?: any, extraHeaders?: any): void;
|
||||
}
|
||||
|
||||
export class WSSecurity implements Security {
|
||||
constructor(username: string, password: string, options?: any);
|
||||
}
|
||||
@@ -34,7 +38,7 @@ export interface Client extends events.EventEmitter {
|
||||
setEndpoint(endpoint: string): void;
|
||||
setSOAPAction(action: string): void;
|
||||
setSecurity(s: Security): void;
|
||||
[method: string]: (args: any, callback: (err: any, result: any) => void, options?: any, extraHeaders?: any) => void;
|
||||
[method: string]: SoapMethod | Function;
|
||||
}
|
||||
|
||||
export interface Server extends events.EventEmitter {
|
||||
|
||||
+2
-3
@@ -1,4 +1,3 @@
|
||||
|
||||
import * as soap from 'soap';
|
||||
import * as events from 'events';
|
||||
import * as fs from "fs";
|
||||
@@ -27,10 +26,10 @@ soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) {
|
||||
client.getHttpHeaders();
|
||||
client.getSoapHeaders();
|
||||
client.setSOAPAction('action');
|
||||
client['create']({ name: 'value' }, function(err: any, result: any) {
|
||||
(client['create'] as soap.SoapMethod)({ name: 'value' }, function(err: any, result: any) {
|
||||
// result is an object
|
||||
});
|
||||
client['create']({ name: 'value' }, function(err: any, result: any) {
|
||||
(client['create'] as soap.SoapMethod)({ name: 'value' }, function(err: any, result: any) {
|
||||
// result is an object
|
||||
}, {});
|
||||
client.on('request', function(obj: any) {
|
||||
|
||||
Reference in New Issue
Block a user