Code looks like this:


    soap.createClient(url, (err, client) => {
if (err) {
logger.error('Error : %s', err);
return;
}

        client.setSecurity(new soap.BasicAuthSecurity(username, password));
        client.doJob(args, function(err, result, rawResponse, soapHeader, 
rawRequest) {
    if (err) {
        logger.error('Error %s', err.message);
   
    } else {
    // Since SOAP Client returns 401 as success, I need to find the http 
status
    // and act accordingly. 
            logger.info('success');
    },
}, { 
    timeout: timeout
        });
    });







On Sunday, May 20, 2018 at 7:58:05 PM UTC+5:30, Ritesh Gupta wrote:
>
> Hi,
>
> I have a soap client, which makes a web service call with Basic 
> Authentication. The web service that I am calling has implemented 
> "basic-auth" to authenticate the user. Something like below:
>
>
>         app.use(basicAuth({  
>           users: {
>                        'test': 'test123'
>               }
>
>         }));
>
>
> With this implementation, client (soap client) receives http status code 
> (as 401) and soap body is empty and my implementation states this as 
> success. 
>
> On client, how do I retrieve this status code to figure out the state of 
> the response? i tried looking at last "lastResponseHeaders" of soapClient 
> but this data is not there. My code looks like this:
>
> soap.createClient(url, (err, client) => {
> if (err) {
> logger.error('Error : %s', err);
> return;
> }
>
>           client.setSecurity(new soap.BasicAuthSecurity(username, 
> password));
>                client.doJob(args, function(err, result, rawResponse, 
> soapHeader, rawRequest) {
>
>         if (err) {
>                   logger.error('Error %s', err.message);
>    
>         } else {
>                              logger.info('success');
>          }, { 
>              timeout: heartbeatTimeout
>                         }
>        });
> });
>
> Thanks,
> Ritesh
>
>
>
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/366bfb1b-4b09-4b61-a899-9c079e27b2e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to