I am trying to use library nodejs-soap (https://github.com/vpulim/node-soap) 
but do not know how to use SSL and usernameToken auth.

So my code goes like this: 

var url = 'https://test.wsdl'; var auth = "Basic " + new Buffer("test" + ":" 
+ "test").toString("base64"); var token = wsse({ username: 'test', 
password: 'test' }); soap.createClient( url, {wsdl_options: { cert: 
fs.readFileSync('cert/test.pem'), key: fs.readFileSync('cert/test.key'), 
strictSSL: false, rejectUnauthorized: false, secureOptions : require(
'constants').SSL_OP_NO_TLSv1_2 }, endpoint : 'https://test.com'}, function(err, 
client) { if(err) {throw err;} /* client.setSecurity(new 
soap.ClientSSLSecurity( 'cert/test.key' , 'cert/test.pem' , { strictSSL: 
false, rejectUnauthorized: false, secureOptions : 
require('constants').SSL_OP_NO_TLSv1_2 } )); */ console.log(client.describe() 
); client.admGetSubscriber({input: {msisdn: 123213}}, {wsdl_headers: { 
Username: 'test', Password: token.getPasswordDigest() }}, function(err, 
result){ if (err) throw err; //throw err; }); });

When I use soap.createClient(), in callbackI can see that wdsl is recived 
from url, so to this point SSL works (no need for usernameToken auth). Then 
when I try to use client and call some function I must define again SSL 
client.setSecurity(new soap.ClientSSLSecurity()) otherwise I will get SSL 
error (again?). In post I must also define usernameToken auth otherwise 
server will reject request. The issue is that I can not define 
client.setSecurity two times as only the last will be used.

tnx for all help!

Job board: http://jobs.nodejs.org/
New group rules: 
Old group rules: 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to