V
V
Vlad Lopushenko2020-01-04 02:17:19
SOAP
Vlad Lopushenko, 2020-01-04 02:17:19

How to force soap in node to pass location?

Everything is fine exactly until I start making another request :(

var 
 soap = require('soap'),
 config = {
      url: 'https://192.168.0.5',
      port: 60,
      def: {
        login : 'admin',
        pass : ''
      }
    },
 args = {trace: 1,exceptions:1,location:`${config.url}:${config.port}`,rejectUnauthorized: false,};

soap.createClient(`${config.url}:${config.port}?wsdl`,{wsdl_options: args}, function(err, client) {
  client.Login(config.def.login, config.def.pass, function(err, response) {
  	if (err) console.log(err);
  	else console.log('ok');
  });
});

Already broke my head :(
I get the initial page and then the request does not go :(

{ Error: connect ECONNREFUSED 127.0.0.1:60
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1083:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0. 0.1',
port: 60}

What I'm trying to fix (But this is not accurate, there is no other data on where the request can go)
<wsdl:definitions>
<wsdl:service name="sms_1">
<wsdl:port name="sms_1Soap12" binding="tns:sms_1Soap12">
<soap12:address location="https://www.localhost:60"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad Lopushenko, 2020-01-06
@vald5116

Well, in general, the answer to my question was found And also if someone has problems with a self-signed certificate, then here is the solution

client.setSecurity(new soap.ClientSSLSecurity(undefined,undefined, undefined, {rejectUnauthorized: false,},));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question