milewise/node-soap — Issue #13: 'This request requires HTTP authentication ()' using soap.BasicAuthSecurity
Author: brunoqc
Created: 2011-12-16 22:16:53+00:00
State: open

I got `This request requires HTTP authentication ()` using soap.BasicAuthSecurity.

# Code

var soap = require('soap');

var wsdl = 'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl';

soap.createClient(wsdl, function(err, client) {
client.setSecurity(new soap.BasicAuthSecurity('user', 'password'));

if (err) {
console.log(err.stack);
return;
} else {
client.download({startTime: '2011-12-16T00:00:00Z', endTime:'2011-12-17T01:00:00Z'}, function(err, result) {
if (err) {
console.log('err', err);
} else {
console.log('result', result);
}
});
}
});

# Wireshark capture

POST /schedulesdirect/tvlistings/xtvdService HTTP/1.1
User-Agent: node-soap/0.0.1
Accept: text/html,application/xhtml+xml,application/xml
Accept-Encoding: none
Accept-Charset: utf-8
Connection: close
host: webservices.schedulesdirect.tmsdatadirect.com
Content-Length: 341
Content-Type: text/xml; charset=utf-8
SOAPAction: urn:TMSWebServices/download
Authorization: Basic YnJ1bm9xYzpvaFdhaDVmZQ==
Cookie:

2011-12-16T00:00:00Z2011-12-17T01:00:00ZHTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
WWW-Authenticate: Digest realm="TMSWebServiceRealm", qop="auth", nonce="81beef50496a1cefe6e04f887adc2a7b", opaque="f7bbafe1a2ff7458b80ccf27c4b60e48"
Content-Type: text/html;charset=utf-8
Content-Length: 954
Date: Fri, 16 Dec 2011 22:08:06 GMT
Connection: close

Apache Tomcat/5.5.20 - Error report

HTTP Status 401 -

type Status report

message

description

This request requires HTTP authentication ().

Apache Tomcat/5.5.20

# Here's a capture from a working script :

POST /schedulesdirect/tvlistings/xtvdService HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Accept-Encoding: gzip
Authorization: Digest username="brunoqc", realm="TMSWebServiceRealm", qop="auth", algorithm="MD5", uri="/schedulesdirect/tvlistings/xtvdService", nonce="7774e1cdbb030736a24150dafcf896da", nc="00000001", cnonce="4eebbd7f", response="1e20851366976a4af3c622397550cd13", message-digest="d41d8cd98f00b204e9800998ecf8427e", opaque="08ffd33d76109d216658e141d8d2b358"
Host: webservices.schedulesdirect.tmsdatadirect.com
User-Agent: xmltv/0.5.59
Content-Length: 497
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:TMSWebServices:xtvdWebService#download"

2011-12-16T00:00:01Z2011-12-23T00:00:01Z