mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Merge pull request #9722 from hongshanzhu/master
add two interface:ClientSSLSecurity and setEndpoint
This commit is contained in:
@@ -11,7 +11,10 @@ const wsdlOptions = { name: 'value' };
|
||||
soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) {
|
||||
let securityOptions = { 'hasTimeStamp': false };
|
||||
client.setSecurity(new soap.WSSecurity('user', 'password', securityOptions));
|
||||
let defaults = {'rejectUnauthorized': false};
|
||||
client.setSecurity(new soap.ClientSSLSecurity('/path/to/key', '/path/to/cert', '/path/to/ca',defaults));
|
||||
client.addSoapHeader({});
|
||||
client.setEndpoint('http://localhost');
|
||||
client['create']({ name: 'value' }, function(err, result) {
|
||||
// result is an object
|
||||
});
|
||||
|
||||
Vendored
+8
-2
@@ -8,13 +8,19 @@
|
||||
declare module 'soap' {
|
||||
import * as events from 'events';
|
||||
|
||||
class WSSecurity {
|
||||
interface Security {
|
||||
}
|
||||
class WSSecurity implements Security {
|
||||
constructor(username: string, password: string, options: any);
|
||||
}
|
||||
class ClientSSLSecurity implements Security {
|
||||
constructor(key: string, cert: string, ca: string, defaults: any);
|
||||
}
|
||||
interface Client extends events.EventEmitter {
|
||||
setSecurity(s: WSSecurity): void;
|
||||
setSecurity(s: Security): void;
|
||||
[method: string]: (args: any, fn: (err: any, result: any) => void, options?: any, extraHeaders?: any) => void;
|
||||
addSoapHeader(headJSON: any): void;
|
||||
setEndpoint(endpoint: string): void;
|
||||
}
|
||||
function createClient(wsdlPath: string, options: any, fn: (err: any, client: Client) => void): void;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user