Q
Problem solve Get help with specific problems with your technologies, process and projects.

Calling a LotusScript agent

SearchDomino.com expert Cregg Hardwick provides code that will call a LotusScript agent.

I know how to call a Java agent from LotusScript, but I do not know how to call a LotusScript agent from a Java program. Can you please help?

VIEW MEMBER FEEDBACK TO THIS ASK THE EXPERT Q&A.

I do not believe this is possible as of Lotus Domino R6, but you can call a LotusScript agent using something like this:

URL url = new URL(protoHost +
"/sample.nsf/MyAgent"+ "?OpenAgent&Value="
+Parms);

MEMBER FEEDBACK TO THIS ASK THE EXPERT Q&A:

If you have an active CORBA-DIIOP connection in your Domino server you can use this connector.

For example, with "pure" JAVA (compiled with Sun JDK):

import lotus.domino.*; 
import java.util.*; 

public class agente { 

public static void main
(String args[[]) { 
try{ 
Session s; 
String server; 
String usuario="yourhttpuser"; 
String pwd="httppwd"; 
String bdnombre; 
String agent; 
                
server="IP or DSN NAME"; 

s=NotesFactory.createSession
(server, usuario, pwd); 

bdnombre="TestAgentes.nsf"; 
Database db=
s.getDatabase(server, bdnombre); 

if(!db.isOpen()) { 
System.out.println
("No se puedo abrir el aplicativo"); 
System.exit(0); 
                                } 

agent="ServerInfo"; 
 Agent Agente = db.getAgent(agent); 

Agente.runOnServer(); 
  System.out.println
("Mire en el log si ha ido bien"); 
                } 
 catch (NotesException e){ 
System.out.println
("-----------------------------"); 
System.out.println
("Notes Error #" + e.id + " " + e.text);         
System.out.println
("-----------------------------"); 
// e.printStackTrace(); 
               } 
catch(Exception e){ 
e.printStackTrace(); 
                } 

        } 
} 

—Pedro F.

Do you have comments on this Ask the Expert Q&A? Let us know.

Related information from SearchDomino.com:

  • Learning Guide: LotusScript development
  • FAQ: LotusScript advice
  • FAQ: Java for Lotus Notes and Domino
  • Reference Center: LotusScript tips and resources
  • Dig Deeper on LotusScript

    Have a question for an expert?

    Please add a title for your question

    Get answers from a TechTarget expert on whatever's puzzling you.

    You will be able to add details on the next page.

    Start the conversation

    Send me notifications when other members comment.

    Please create a username to comment.

    -ADS BY GOOGLE

    SearchWindowsServer

    Search400

    • iSeries tutorials

      Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

    • V6R1 upgrade planning checklist

      When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

    • Connecting multiple iSeries systems through DDM

      Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

    SearchDataCenter

    SearchContentManagement

    Close