lstak / node-sharepoint

Connecting Node and SharePoint
http://allthatjs.com/2012/03/29/node-js-meet-sharepoint/
104 stars 41 forks source link

cant sign in to site #7

Open pmaheshgupta opened 11 years ago

pmaheshgupta commented 11 years ago

wen trying to sign in to my share point site it is throwing following error

if (js['S:Body']['S:Fault']) { ^ TypeError: Cannot read property 'S:Fault' of undefined at E:\My Examples\nodetestsamples\samplechat2\node_modules\sharepoint\sharep oint.js:114:33 at Parser. (E:\My Examples\nodetestsamples\samplechat2\node_modul es\sharepoint\sharepoint.js:27:21) at Parser.EventEmitter.emit (events.js:95:17) at Object.saxParser.onclosetag (E:\My Examples\nodetestsamples\samplechat2\n ode_modules\sharepoint\node_modules\xml2js\lib\xml2js.js:225:24) at emit (E:\My Examples\nodetestsamples\samplechat2\node_modules\sharepoint\ node_modules\xml2js\node_modules\sax\lib\sax.js:589:33) at emitNode (E:\My Examples\nodetestsamples\samplechat2\node_modules\sharepo int\node_modules\xml2js\node_modules\sax\lib\sax.js:594:3) at closeTag (E:\My Examples\nodetestsamples\samplechat2\node_modules\sharepo int\node_modules\xml2js\node_modules\sax\lib\sax.js:834:5) at Object.write (E:\My Examples\nodetestsamples\samplechat2\node_modules\sha repoint\node_modules\xml2js\node_modules\sax\lib\sax.js:1253:29) at Parser.exports.Parser.Parser.parseString (E:\My Examples\nodetestsamples\ samplechat2\node_modules\sharepoint\node_modules\xml2js\lib\xml2js.js:264:29) at Parser.parseString (E:\My Examples\nodetestsamples\samplechat2\node_modul es\sharepoint\node_modules\xml2js\lib\xml2js.js:77:45)

I am using the following code to login

var SP = require('sharepoint'), site = 'http://vsp113:11291/sites/ChatroomSite', username = 'domainname\username', password = 'password', spclient = new SP.RestService(site);

spclient.signin(username, password, function (err,data) {

// At this point, authentication is complete,
// so we can do requests.    
if(err)
{
console.log('error occourec : '+err);
}

console.log('sharepoint login completed sucessfull'); });

it is not even entering the if (err) block

TotallyInformation commented 11 years ago

Same error. SharePoint Online 2013.

timelyportfolio commented 11 years ago

don't know if it helps, but I remember I ran into a whitespace error that was causing me trouble. See if my forked code https://github.com/timelyportfolio/node-sharepoint?source=c might help.

SPlatten commented 9 years ago

I have exactly the same issue, unfortunately the above link does not help.

var SP = require("sharepoint"); info.msg("Sharepoint signin"); var spCli = new SP.RestService("URL to Sharepoint"), lstAbsence = spCli.list("List to access"), showResponse = function(err, data) { console.dir(err); console.dir(data); }; spCli.signin("login", "password", function(e, data) { try{ if ( e ) { throw("Error signing in: " + e); } lstAbsence.get(showResponse); } catch( ex ) { err.msg({"method":"signin", "ex":ex}); }
}); Some of the elements above are my own objects 'info' and 'err'

All I get is: Cannot read property 'S:Fault' of undefined

4islam commented 8 years ago

Same here, just upon calling client.signin() function:

~/node_modules/sharepoint/node_modules/xml2js/lib/xml2js.js:509 throw err; ^ TypeError: Cannot read property 'S:Fault' of undefined

TotallyInformation commented 8 years ago

There really is no point in trying to use this module as it is clearly abandoned. It doesn't work with newer versions of SharePoint. I managed to fix one of the issues but it simply fails later on.

Lets hope that Microsoft release some better code for node.js

4islam commented 8 years ago

Thanks a lot for your repose Julian. You are right, not worth it.

On Nov 19, 2015, at 6:07 PM, Julian Knight notifications@github.com wrote:

There really is no point in trying to use this module as it is clearly abandoned. It doesn't work with newer versions of SharePoint. I managed to fix one of the issues but it simply fails later on.

Lets hope that Microsoft release some better code for node.js

— Reply to this email directly or view it on GitHub.