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:
-
User opens a URL on the customers website.
-
Client browser makes a request to the “middleman script” above thru AJAX.
-
“Middleman script” requests and retrives data from remote server.
-
Client retrieves data from “middleman script” and updates the page the user is looking at without any reloading.