D
D
Danil2017-10-10 17:47:13
SOAP
Danil, 2017-10-10 17:47:13

How to log into SOAP?

You need to pull data from a third-party SOAP resource. In the browser I go to the link, there I promptly enter the login / password and go. It doesn't work that way in the code. I am using soap.
My code:

var soap = require('soap');
var url = 'http://192.168.1.1/ws/test.1cws?wsdl';
 soap.createClient(url, args, function(err, client) {
        console.log(err)
        client.setSecurity(new soap.BasicAuthSecurity('SuperLogin', 'SuperPassword'));
    });

I run it and get it right away like this:
Error: Invalid WSDL URL: http://192.168.1.1/ws/test.1cws?wsdl
Code: 401

And right after that:
TypeError: Cannot read property 'setSecurity' of undefined

That is, it writes me 401 even before I specify authorization. How can I login then?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2017-10-10
@Veneomin

most likely there Basic authorization.
The easiest way to do so
UPD.
options with the `wsdl_options` property can be passed as a parameter to the `soap.createClient` method. I suspect these are options for the request module to request a wsdl download.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question