Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. var soap = require('soap');
  2. var url = 'your WSDL url';
  3. var auth = "Basic " + new Buffer("your username" + ":" + "your password").toString("base64");
  4.  
  5. soap.createClient(url, { wsdl_headers: {Authorization: auth} }, function(err, client) {
  6. });
  7.  
  8. var soap = require('soap');
  9. var url = 'AXLAPI.wsdl'; // Download this file and xsd files from cucm admin page
  10. var auth = "Basic " + new Buffer("your username" + ":" + "your password").toString("base64");
  11. soap.createClient(url,function(err,client){
  12. client.addHttpHeader('Authorization',auth);
  13. });
  14.  
  15. var soap = require('soap');
  16. var url = 'your WSDL url';
  17.  
  18. soap.createClient(url, function(err, client) {
  19. client.setSecurity(new soap.BasicAuthSecurity('your username','your password'));
  20. });
  21.  
  22. var auth = "Basic " + new Buffer('username' + ':' + 'password').toString("base64");
  23.  
  24. var client = Soap.createClient('wsdlUrl', { wsdl_headers: { Authorization: auth } }, (err, client) => {
  25. if (err) {
  26. throw err;
  27. } else {
  28. client.yourMethod();
  29. }
  30. });
  31.  
  32. const security = new soap.BasicAuthSecurity(username, password);
  33. const wsdl_headers = {};
  34. security.addHeaders(wsdl_headers);
  35. soap.createClientAsync(url, { wsdl_headers }).then((err, client) => {
  36. client.setSecurity(security);
  37. // etc.
  38. });
  39.  
  40. const security = new soap.NTLMSecurity(username, password, domain, workstation);
  41. const wsdl_headers = {}, wsdl_options = {};
  42. security.addHeaders(wsdl_headers);
  43. security.addOptions(wsdl_options);
  44. soap.createClientAsync(url, { wsdl_headers, wsdl_options }).then((err, client) => {
  45. client.setSecurity(security);
  46. // etc.
  47. });
  48.  
  49. I am getting this error:
  50. Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames
  51.  
  52. Here's my code:
  53.  
  54. var soap = require('soap');
  55. var url = 'your WSDL url';
  56. var auth = "Basic " + new Buffer("your username" + ":" + "your password").toString("base64");
  57.  
  58. soap.createClient(url, { wsdl_headers: {Authorization: auth} }, function(err, client) {
  59. client.setSecurity(new soap.BasicAuthSecurity('your username','your password'));
  60. client.yourfunction(args, function (err, result) {
  61. if (err) {
  62. console.log('Error: ', err);
  63. }
  64. else {
  65. console.log('Result: ', result);
  66. }
  67. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement