How can I use a script on Domino webserver?

Hi everyone

I was wondering if its possible to put a script on a domino webserver running on a Windows server. The script is meant to be a “middleman” for an AJAX application that retrives data from an external server/domain. This is needed to bypass the built in restrictions in XMLHTTP clientside, that only allows retrival from the same domain.

Ive put in the script that we usually use for this on Windows servers, and hopefully one of you can tell me what to do, to make it work on a Domino webserver.

Any help is really appreciated!


Response.Buffer = True

'— Url to datasource

SourceUrl = “http://www.domain.com/data.asp

'— Querystring to pass along

RequestQS = Trim(Request.QueryString(“get”))

If RequestQS = “” Then

RequestQS = "a|s|all"

End If

Dim xmlSource

Set xmlSource = Server.CreateObject(“MSXML2.ServerXMLHTTP.3.0”)

lResolve = 30 * 1000

lConnect = 30 * 1000

lSend = 30 * 1000

lReceive = 30 * 1000



RequestUrl = SourceUrl & "?get=" & RequestQS



xmlSource.setTimeouts lResolve, lConnect, lSend, lReceive

xmlSource.Open "GET", RequestUrl, False

xmlSource.Send

xmlString = ""



'--- Return data or error message

If xmlSource.status = 200 Then

	xmlString = xmlSource.ResponseText

	Response.Write(xmlString)

Else

	Response.Write("Error requesting data.")

End If

Set xmlSource = Nothing


What basiclly happens is this:

  1. User opens a URL on the customers website.

  2. Client browser makes a request to the “middleman script” above thru AJAX.

  3. “Middleman script” requests and retrives data from remote server.

  4. Client retrieves data from “middleman script” and updates the page the user is looking at without any reloading.

Subject: How can I use a script on Domino webserver?

You’ll need to put your script in an Agent using LotusScript. If you search this forum for MSXML2 you’ll see lots of samples. It’s not very different from your current script.

Respone.Write = Print

Server.CreateObject = CreateObject

Request.QueryString = NotesSession.DocumentContext.Query_String_Decoded(0)