LotusScript GetDocumentByURL not authenticating in scheduled agent












1















I have a LotusScript agent that works manually when run from the Notes client menu but fails when run as a scheduled agent on the server. The agent gets a web page using the GetDocumentByURL method.



url$="http://example.com/notesdb.nsf/XAgent.xsp?documentId="+ Quotesdoc.Universalid +"&action=openDocument&login"

Print("url "+ url$)

Set doc = db.GetDocumentByURL(url$, 1, , , "username", "password")
Set rtitem = doc.GetFirstItem( "Body" )
body$ = rtitem.text

Print("status "+body$)


From the Notes client, the agent will authenticate and return a JSON object. But from a scheduled agent on the server, the authentication appears to fail as the response is 200, login failed.



The Web Retriever service is running, and the web.nsf db has a Cookies view, but the server log shows:



11/13/2018 07:07:36 PM  AMgr: Agent ('Scheduled Agent' in 'mailmailer.nsf') printing: url http://example.com/notesdb.nsf/XAgent.xsp?documentId=61D46EE586868DBA85256C84005414B9&action=openDocument&login
11/13/2018 07:07:36 PM WEB(3): Unable to find design note for view 'Cookies': Entry not found in index
11/13/2018 07:07:36 PM AMgr: Agent ('Scheduled Agent' in 'mailmailer.nsf') printing: status Forgot password?


My guess is that the SessionID is not being passed via a cookie and the authentication is failing. Ideas?










share|improve this question























  • Do you have a view "Cookies" in your DB object ?

    – umeli
    Nov 14 '18 at 8:01






  • 1





    this method imho is built to be used in context with the Server Web Navigator database. Is the Web Navigator retrieval process running on your machine? - also I find it curious that your URL ends with "&login"; this usually pops up a login dialog or login page depending on the way you set up your Domino server

    – Lothar Mueller
    Nov 14 '18 at 12:42











  • I don't think I've seen getDocumentByURL used in 15 years. If you're running on Windows, is there a reason you're going that way rather than using XmlHttpRequest instead?

    – Richard Schwartz
    Nov 14 '18 at 19:33











  • Or for that matter, why not access the database using the regular Notes classes? That way signatures and authentication and such are already handled.

    – Duston
    Nov 14 '18 at 20:29













  • I'm calling an XPage to run a java program that will not work with LS2J in LotusScript. I've decided to go with stackoverflow.com/questions/12719192/… using MSXML2.ServerXMLHTTP

    – teleman
    Nov 14 '18 at 21:11
















1















I have a LotusScript agent that works manually when run from the Notes client menu but fails when run as a scheduled agent on the server. The agent gets a web page using the GetDocumentByURL method.



url$="http://example.com/notesdb.nsf/XAgent.xsp?documentId="+ Quotesdoc.Universalid +"&action=openDocument&login"

Print("url "+ url$)

Set doc = db.GetDocumentByURL(url$, 1, , , "username", "password")
Set rtitem = doc.GetFirstItem( "Body" )
body$ = rtitem.text

Print("status "+body$)


From the Notes client, the agent will authenticate and return a JSON object. But from a scheduled agent on the server, the authentication appears to fail as the response is 200, login failed.



The Web Retriever service is running, and the web.nsf db has a Cookies view, but the server log shows:



11/13/2018 07:07:36 PM  AMgr: Agent ('Scheduled Agent' in 'mailmailer.nsf') printing: url http://example.com/notesdb.nsf/XAgent.xsp?documentId=61D46EE586868DBA85256C84005414B9&action=openDocument&login
11/13/2018 07:07:36 PM WEB(3): Unable to find design note for view 'Cookies': Entry not found in index
11/13/2018 07:07:36 PM AMgr: Agent ('Scheduled Agent' in 'mailmailer.nsf') printing: status Forgot password?


My guess is that the SessionID is not being passed via a cookie and the authentication is failing. Ideas?










share|improve this question























  • Do you have a view "Cookies" in your DB object ?

    – umeli
    Nov 14 '18 at 8:01






  • 1





    this method imho is built to be used in context with the Server Web Navigator database. Is the Web Navigator retrieval process running on your machine? - also I find it curious that your URL ends with "&login"; this usually pops up a login dialog or login page depending on the way you set up your Domino server

    – Lothar Mueller
    Nov 14 '18 at 12:42











  • I don't think I've seen getDocumentByURL used in 15 years. If you're running on Windows, is there a reason you're going that way rather than using XmlHttpRequest instead?

    – Richard Schwartz
    Nov 14 '18 at 19:33











  • Or for that matter, why not access the database using the regular Notes classes? That way signatures and authentication and such are already handled.

    – Duston
    Nov 14 '18 at 20:29













  • I'm calling an XPage to run a java program that will not work with LS2J in LotusScript. I've decided to go with stackoverflow.com/questions/12719192/… using MSXML2.ServerXMLHTTP

    – teleman
    Nov 14 '18 at 21:11














1












1








1








I have a LotusScript agent that works manually when run from the Notes client menu but fails when run as a scheduled agent on the server. The agent gets a web page using the GetDocumentByURL method.



url$="http://example.com/notesdb.nsf/XAgent.xsp?documentId="+ Quotesdoc.Universalid +"&action=openDocument&login"

Print("url "+ url$)

Set doc = db.GetDocumentByURL(url$, 1, , , "username", "password")
Set rtitem = doc.GetFirstItem( "Body" )
body$ = rtitem.text

Print("status "+body$)


From the Notes client, the agent will authenticate and return a JSON object. But from a scheduled agent on the server, the authentication appears to fail as the response is 200, login failed.



The Web Retriever service is running, and the web.nsf db has a Cookies view, but the server log shows:



11/13/2018 07:07:36 PM  AMgr: Agent ('Scheduled Agent' in 'mailmailer.nsf') printing: url http://example.com/notesdb.nsf/XAgent.xsp?documentId=61D46EE586868DBA85256C84005414B9&action=openDocument&login
11/13/2018 07:07:36 PM WEB(3): Unable to find design note for view 'Cookies': Entry not found in index
11/13/2018 07:07:36 PM AMgr: Agent ('Scheduled Agent' in 'mailmailer.nsf') printing: status Forgot password?


My guess is that the SessionID is not being passed via a cookie and the authentication is failing. Ideas?










share|improve this question














I have a LotusScript agent that works manually when run from the Notes client menu but fails when run as a scheduled agent on the server. The agent gets a web page using the GetDocumentByURL method.



url$="http://example.com/notesdb.nsf/XAgent.xsp?documentId="+ Quotesdoc.Universalid +"&action=openDocument&login"

Print("url "+ url$)

Set doc = db.GetDocumentByURL(url$, 1, , , "username", "password")
Set rtitem = doc.GetFirstItem( "Body" )
body$ = rtitem.text

Print("status "+body$)


From the Notes client, the agent will authenticate and return a JSON object. But from a scheduled agent on the server, the authentication appears to fail as the response is 200, login failed.



The Web Retriever service is running, and the web.nsf db has a Cookies view, but the server log shows:



11/13/2018 07:07:36 PM  AMgr: Agent ('Scheduled Agent' in 'mailmailer.nsf') printing: url http://example.com/notesdb.nsf/XAgent.xsp?documentId=61D46EE586868DBA85256C84005414B9&action=openDocument&login
11/13/2018 07:07:36 PM WEB(3): Unable to find design note for view 'Cookies': Entry not found in index
11/13/2018 07:07:36 PM AMgr: Agent ('Scheduled Agent' in 'mailmailer.nsf') printing: status Forgot password?


My guess is that the SessionID is not being passed via a cookie and the authentication is failing. Ideas?







http lotus-notes lotus-domino lotusscript






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 0:33









telemanteleman

530312




530312













  • Do you have a view "Cookies" in your DB object ?

    – umeli
    Nov 14 '18 at 8:01






  • 1





    this method imho is built to be used in context with the Server Web Navigator database. Is the Web Navigator retrieval process running on your machine? - also I find it curious that your URL ends with "&login"; this usually pops up a login dialog or login page depending on the way you set up your Domino server

    – Lothar Mueller
    Nov 14 '18 at 12:42











  • I don't think I've seen getDocumentByURL used in 15 years. If you're running on Windows, is there a reason you're going that way rather than using XmlHttpRequest instead?

    – Richard Schwartz
    Nov 14 '18 at 19:33











  • Or for that matter, why not access the database using the regular Notes classes? That way signatures and authentication and such are already handled.

    – Duston
    Nov 14 '18 at 20:29













  • I'm calling an XPage to run a java program that will not work with LS2J in LotusScript. I've decided to go with stackoverflow.com/questions/12719192/… using MSXML2.ServerXMLHTTP

    – teleman
    Nov 14 '18 at 21:11



















  • Do you have a view "Cookies" in your DB object ?

    – umeli
    Nov 14 '18 at 8:01






  • 1





    this method imho is built to be used in context with the Server Web Navigator database. Is the Web Navigator retrieval process running on your machine? - also I find it curious that your URL ends with "&login"; this usually pops up a login dialog or login page depending on the way you set up your Domino server

    – Lothar Mueller
    Nov 14 '18 at 12:42











  • I don't think I've seen getDocumentByURL used in 15 years. If you're running on Windows, is there a reason you're going that way rather than using XmlHttpRequest instead?

    – Richard Schwartz
    Nov 14 '18 at 19:33











  • Or for that matter, why not access the database using the regular Notes classes? That way signatures and authentication and such are already handled.

    – Duston
    Nov 14 '18 at 20:29













  • I'm calling an XPage to run a java program that will not work with LS2J in LotusScript. I've decided to go with stackoverflow.com/questions/12719192/… using MSXML2.ServerXMLHTTP

    – teleman
    Nov 14 '18 at 21:11

















Do you have a view "Cookies" in your DB object ?

– umeli
Nov 14 '18 at 8:01





Do you have a view "Cookies" in your DB object ?

– umeli
Nov 14 '18 at 8:01




1




1





this method imho is built to be used in context with the Server Web Navigator database. Is the Web Navigator retrieval process running on your machine? - also I find it curious that your URL ends with "&login"; this usually pops up a login dialog or login page depending on the way you set up your Domino server

– Lothar Mueller
Nov 14 '18 at 12:42





this method imho is built to be used in context with the Server Web Navigator database. Is the Web Navigator retrieval process running on your machine? - also I find it curious that your URL ends with "&login"; this usually pops up a login dialog or login page depending on the way you set up your Domino server

– Lothar Mueller
Nov 14 '18 at 12:42













I don't think I've seen getDocumentByURL used in 15 years. If you're running on Windows, is there a reason you're going that way rather than using XmlHttpRequest instead?

– Richard Schwartz
Nov 14 '18 at 19:33





I don't think I've seen getDocumentByURL used in 15 years. If you're running on Windows, is there a reason you're going that way rather than using XmlHttpRequest instead?

– Richard Schwartz
Nov 14 '18 at 19:33













Or for that matter, why not access the database using the regular Notes classes? That way signatures and authentication and such are already handled.

– Duston
Nov 14 '18 at 20:29







Or for that matter, why not access the database using the regular Notes classes? That way signatures and authentication and such are already handled.

– Duston
Nov 14 '18 at 20:29















I'm calling an XPage to run a java program that will not work with LS2J in LotusScript. I've decided to go with stackoverflow.com/questions/12719192/… using MSXML2.ServerXMLHTTP

– teleman
Nov 14 '18 at 21:11





I'm calling an XPage to run a java program that will not work with LS2J in LotusScript. I've decided to go with stackoverflow.com/questions/12719192/… using MSXML2.ServerXMLHTTP

– teleman
Nov 14 '18 at 21:11












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53291482%2flotusscript-getdocumentbyurl-not-authenticating-in-scheduled-agent%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53291482%2flotusscript-getdocumentbyurl-not-authenticating-in-scheduled-agent%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine