Agents puuling data

I want to pull data from a servlet on another server into an agent during the wqo event. I need to do it using SSL and I need to do it by POSTing a form to the servlet with the username and password within the form so that it gets passed in the encrypted stream rather than in an URL. This way, the responding servlet can answer if the user is valid and simply ignore the POST if the user is invalid.

Call it web services if you like, but I’m (at this time) not overly concerned with following a standard format - I just want to securely pull live realtime data from other Domino servers.

Using the code below and other instructions concerning installaion of JSSE that some of you have so generously contributed, I’ve managed to make encrypted connections and return data - works like a charm! I just can’t figure out how to send the POST and then listen for the response.

Any ideas?

Thanks,

Charlie

System.setProperty(“java.protocol.handler.pkgs”,“com.sun.net.ssl.internal.www.protocol”);

String MYURL = “https://localhost/names.nsf/groups?ReadViewEntries”;

URL myurl = new URL(MYURL);

com.sun.net.ssl.HttpsURLConnection myConnection = (com.sun.net.ssl.HttpsURLConnection) myurl.openConnection();

InputStreamReader isr = new InputStreamReader(myConnection.getInputStream());

BufferedReader in = new BufferedReader(isr);

String myString = in.readLine();

while (myString != null) {

System.out.println(myString);

myString=in.readLine();

}

Subject: Agents puuling data

You said all these servers are domino right? Then why don’t you just user agents to natively get the data from domino. In R6 servers can open data on other servers – a key benefit of R6.

I just feel it is a lot of effort you are doing just to have one domino server get data from other domino servers.

HTH – Cheers

Subject: RE: Agents puuling data

Joe,

Yes, at first it will be a mixture of R5 and R6, but eventually it will be all R6. I just checked the help file and NotesDatabase class for LotusScript and Database class for Java both state:

“A script that runs on a server cannot open a database that’s on a different server. An error is returned if your script attempts to do so.”

I saw that @DbLookup now works across servers, but I need to fill about 20 ComputedForDisplay fields - that would be VERY slow and it won’t work at all until all of the customers servers ar R6.

I can easily write a servlet that will accept a POST command and verify the password (I know of no way to handle a session ID) and then return all of the fields in one response to the wqo agent. My only stumbling block is that I haven’t managed to get a POST command to work.

R/s,

Charlie

Subject: RE: Agents puuling data

Charles,In R6 I was able to have each server access data on other servers. I had my development R6 server write documents to the production R6 server without any problems. I used the LotusScript classes.

HTH – Cheer (feel free to email me if you get stuck)

Subject: RE: Agents puuling data

Joe,

Thank you! Even though the helpfile is STILL saying that it can’t be done, Rick Silva pointed out the Agent FAQ to me which says that it can be done and the instructions about Trusted Servers was right there as well. Granted, I should have thought to check for a FAQ file, but one would think that IBM would update the helpfile as they go…

Anyway, I’ve now got it working in agents and I found that it works in servlets as well (VERY fast!). Now, I can display those 20-odd fields of data live and using servlets, I can display them only as needed using XML Data Islands!

Thank again!

Charlie

Subject: RE: Agents puuling data

Well here is what I have done and I believe other people should be able to duplicate it.

I made a blank database and wrote an agent to have the following code:

Production

Set db = New Notesdatabase(ProductionSer, “log.nsf”)

msgbox db.title

I set the agent to run daily at 2:40 PM Central Time and it show the database title in the log.nsf on the development server.

I did not have to do anything about trusted servers. I just made sure the development server had at least reader access to the desired database.

I knew about this feature because emphasized quite a bit.

HTH – Cheers