Created
March 1, 2014 12:13
-
-
Save lookingcloudy/9288957 to your computer and use it in GitHub Desktop.
Q Problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is the library client now: | |
innotas.createClient() | |
.then(function (client) { | |
innotas.login(client, user, pass) | |
}) | |
.then(function (client) { | |
console.log("calling projects", client); | |
innotas.getProjects(client); | |
}) | |
; | |
This is what is returned: | |
Soap client created <-- called from "createClient" | |
calling projects undefined <-- this is from the above code to indicate the 3rd step in the process. | |
<-- this should not be called yet...until after "Authenticated" appears. | |
Authenticated: d05b3bf6-0896-4a2c-b787-2b6baa4a6da7 <-- This is from step 2 and is the return from the login() function | |
The login return looks like this now: | |
return q.ninvoke(client, 'login', { username: user, password: password }) | |
.then(function (result) { | |
console.log("Authenticated: ", result[0]['return']); | |
self.innotasSessionId = result[0]['return']; | |
return client; | |
}, function (err) { | |
console.log("Error: ", err.body); | |
}) | |
getProjects() looks like this: | |
// CALL WEB SERVICE | |
return q.ninvoke(client, 'findEntity', req) | |
.then(function success (result) { | |
console.log('retrieved list of projects ', result); | |
}, function fail (err) { | |
console.log('err getting projects ', err.body); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment