mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Add method describe to Client. (#13266)
This commit is contained in:
committed by
Masahiro Wakame
parent
94c44cad2e
commit
2157d75e67
Vendored
+1
@@ -23,6 +23,7 @@ interface Client extends events.EventEmitter {
|
||||
[method: string]: (args: any, fn: (err: any, result: any) => void, options?: any, extraHeaders?: any) => void;
|
||||
addSoapHeader(headJSON: any): void;
|
||||
setEndpoint(endpoint: string): void;
|
||||
describe(): any;
|
||||
}
|
||||
|
||||
export interface Server extends events.EventEmitter {
|
||||
|
||||
+12
-11
@@ -8,9 +8,9 @@ const url = 'http://example.com/wsdl?wsdl';
|
||||
const wsdlOptions = { name: 'value' };
|
||||
|
||||
soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) {
|
||||
let securityOptions = { 'hasTimeStamp': false };
|
||||
let securityOptions = { hasTimeStamp: false };
|
||||
client.setSecurity(new soap.WSSecurity('user', 'password', securityOptions));
|
||||
let defaults = {'rejectUnauthorized': false};
|
||||
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');
|
||||
@@ -23,6 +23,7 @@ soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) {
|
||||
client.on('request', function(obj: any) {
|
||||
//obj is an object
|
||||
});
|
||||
client.describe();
|
||||
});
|
||||
|
||||
var myService = {
|
||||
@@ -33,23 +34,23 @@ var myService = {
|
||||
name: args.name
|
||||
};
|
||||
},
|
||||
|
||||
// This is how to define an asynchronous function.
|
||||
|
||||
// This is how to define an asynchronous function.
|
||||
MyAsyncFunction: function(args: any, callback: any) {
|
||||
// do some work
|
||||
// do some work
|
||||
callback({
|
||||
name: args.name
|
||||
});
|
||||
},
|
||||
|
||||
// This is how to receive incoming headers
|
||||
|
||||
// This is how to receive incoming headers
|
||||
HeadersAwareFunction: function(args: any, cb: any, headers: any) {
|
||||
return {
|
||||
name: headers.Token
|
||||
};
|
||||
},
|
||||
|
||||
// You can also inspect the original `req`
|
||||
|
||||
// You can also inspect the original `req`
|
||||
reallyDeatailedFunction: function(args: any, cb: any, headers: any, req: any) {
|
||||
console.log('SOAP `reallyDeatailedFunction` request from ' + req.connection.remoteAddress);
|
||||
return {
|
||||
@@ -59,11 +60,11 @@ var myService = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var xml = fs.readFileSync('myservice.wsdl', 'utf8'),
|
||||
server = http.createServer(function(request,response) {
|
||||
response.end("404: Not Found: " + request.url);
|
||||
});
|
||||
|
||||
|
||||
server.listen(8000);
|
||||
soap.listen(server, '/wsdl', myService, xml);
|
||||
|
||||
Reference in New Issue
Block a user