{"issue":{"milestone":null,"user":{"id":24027,"login":"brunoqc","url":"https://api.github.com/users/brunoqc","avatar_url":"https://secure.gravatar.com/avatar/f1c0201e3f1435eaab02c803a33c52ae?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f1c0201e3f1435eaab02c803a33c52ae"},"created_at":"2011-12-16T22:16:53Z","title":"'This request requires HTTP authentication ()' using soap.BasicAuthSecurity","updated_at":"2011-12-16T22:16:53Z","labels":[],"state":"open","id":2585066,"html_url":"https://github.com/milewise/node-soap/issues/13","closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"I got `This request requires HTTP authentication ()` using soap.BasicAuthSecurity.\r\n\r\n# Code\r\n\r\n    var soap = require('soap');\r\n\r\n    var wsdl = 'http://docs.tms.tribune.com/tech/tmsdatadirect/schedulesdirect/tvDataDelivery.wsdl';\r\n\r\n    soap.createClient(wsdl, function(err, client) {\r\n      client.setSecurity(new soap.BasicAuthSecurity('user', 'password'));\r\n    \r\n      if (err) {\r\n        console.log(err.stack);\r\n        return;\r\n      } else {\r\n        client.download({startTime: '2011-12-16T00:00:00Z', endTime:'2011-12-17T01:00:00Z'}, function(err, result) {\r\n          if (err) {\r\n    \tconsole.log('err', err);\r\n          } else {\r\n\t    console.log('result', result);\r\n          }\r\n        });\r\n      }\r\n    });\r\n\r\n# Wireshark capture\r\n\r\n    POST /schedulesdirect/tvlistings/xtvdService HTTP/1.1\r\n    User-Agent: node-soap/0.0.1\r\n    Accept: text/html,application/xhtml+xml,application/xml\r\n    Accept-Encoding: none\r\n    Accept-Charset: utf-8\r\n    Connection: close\r\n    host: webservices.schedulesdirect.tmsdatadirect.com\r\n    Content-Length: 341\r\n    Content-Type: text/xml; charset=utf-8\r\n    SOAPAction: urn:TMSWebServices/download\r\n    Authorization: Basic YnJ1bm9xYzpvaFdhaDVmZQ==\r\n    Cookie: \r\n    \r\n    <soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" soap:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:ns0=\"urn:TMSWebServices\"><soap:Header></soap:Header><soap:Body><ns0:download><startTime>2011-12-16T00:00:00Z</startTime><endTime>2011-12-17T01:00:00Z</endTime></ns0:download></soap:Body></soap:Envelope>HTTP/1.1 401 Unauthorized\r\n    Server: Apache-Coyote/1.1\r\n    WWW-Authenticate: Digest realm=\"TMSWebServiceRealm\", qop=\"auth\", nonce=\"81beef50496a1cefe6e04f887adc2a7b\", opaque=\"f7bbafe1a2ff7458b80ccf27c4b60e48\"\r\n    Content-Type: text/html;charset=utf-8\r\n    Content-Length: 954\r\n    Date: Fri, 16 Dec 2011 22:08:06 GMT\r\n    Connection: close\r\n    \r\n    <html><head><title>Apache Tomcat/5.5.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 401 - </h1><HR size=\"1\" noshade=\"noshade\"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>This request requires HTTP authentication ().</u></p><HR size=\"1\" noshade=\"noshade\"><h3>Apache Tomcat/5.5.20</h3></body></html>\r\n\r\n# Here's a capture from a working script :\r\n\r\n    POST /schedulesdirect/tvlistings/xtvdService HTTP/1.1\r\n    TE: deflate,gzip;q=0.3\r\n    Connection: TE, close\r\n    Accept: text/xml\r\n    Accept: multipart/*\r\n    Accept: application/soap\r\n    Accept-Encoding: gzip\r\n    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\"\r\n    Host: webservices.schedulesdirect.tmsdatadirect.com\r\n    User-Agent: xmltv/0.5.59\r\n    Content-Length: 497\r\n    Content-Type: text/xml; charset=utf-8\r\n    SOAPAction: \"urn:TMSWebServices:xtvdWebService#download\"\r\n    \r\n    <?xml version=\"1.0\" encoding=\"UTF-8\"?><Envelope xmlns:namesp1=\"urn:TMSWebServices\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" namesp2:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:namesp2=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><Body><namesp1:download><startTime xsi:type=\"tms:dateTime\">2011-12-16T00:00:01Z</startTime><endTime xsi:type=\"tms:dateTime\">2011-12-23T00:00:01Z</endTime></namesp1:download></Body></Envelope>","number":13,"url":"https://api.github.com/repos/milewise/node-soap/issues/13","comments":0,"assignee":null},"action":"opened"}