I have client-side code that is running MSXML2.XMLHTTP in a ASP page (ASP1) on a Windows 2003 Server with IIS 6.0. The code passes a SQL string to a server-side ASP page (ASP2) to execute an oracle 8i procedure. The XmlHttp request in ASP1 only hangs when the procedure runs for longer then a minute or so amd takes an error on the client page (msxml3.dll unspecified error), other then that everthing runs fine and the database gets updated for all request.
So the conclusion is that ASP1 sends to ASP2 fine and all updates get processed but on long running requests ASP1 waits on the loadXML and never comes back so we end up killing the IE window.
All the code for the two pages is listed below hopefully someone can offer so help.
--------------------------
-ASP1-----
----------
----------
----------
----------
----------
-----
Dim xmlHTTP, xmlDOM, xmlRoot, strReturnMessage, strParseError, strUpdateSQL
Set xmlHTTP = CreateObject("MSXML2.XMLHT
TP")
xmlHTTP.open "POST", "/XMLFunctions/Nala_Oracle
_Database_
Update.asp
", False
xmlHTTP.send("<REQUEST><sS
QL>"& strSQLCmd &"</sSQL></REQUEST>")
Set xmlDOM = CreateObject("MSXML2.DOMDo
cument")
xmlDOM.loadXML(xmlHTTP.Res
ponseText)
If xmlDOM.parseError <> 0 Then
strParseError = "Error Code: " & xmlDOM.parseError.errorCod
e & Chr(13)
strParseError = strParseError & "Error Reason: " & xmlDOM.parseError.reason & Chr(13)
strParseError = strParseError & "Error Line: " & xmlDOM.parseError.line
nErrNumber= 1
Call MsgBox(strParseError,VbOkO
nly,"S.I.M
.B.B.A -- " & strProcess )
Exit Function
End If
Set xmlRoot = xmlDOM.documentElement
strReturnMessage = xmlRoot.getElementsByTagNa
me("UPDATE
_RESULTS")
(0).firstC
hild.nodeV
alue
If strReturnMessage <> "Record Update Successful" then
Call msgbox(strReturnMessage,0,
"S.I.M.B.B
.A.- Error - " & strProcess)
nErrNumber= 1
Else
nErrNumber= 0
End If
Set xmlHTTP = Nothing
Set xmlDOM = Nothing
Set xmlRoot = Nothing
End Function
--------------------------
----------
----------
ASP2------
----------
----------
----------
----------
----------
-------
<%
Dim cn, xmlDOM, strXML, xmlRoot, sSQL
Dim vNextLine, vTab, szDisplayMessage, szODBCError
Const cMessageStartChars = "<<<"
Const cMessageEndChars = ">>>"
Const cGenericMessageStartChars = "ORA-"
Const cGenericMessageEndChars = "(#"
Set cn = Server.CreateObject("ADODB
.Connectio
n")
cn.Open Session("ConnectionString"
)
Set xmlDOM = Server.CreateObject("MSXML
2.DOMDocum
ent")
xmlDOM.load(Request)
If xmlDOM.parseError <> 0 Then
Response.Write("Error in Request: " & xmlDOM.parseError.reason)
Response.End
End If
Set xmlRoot = xmlDOM.documentElement
sSQL = xmlRoot.getElementsByTagNa
me("sSQL")
(0).firstC
hild.nodeV
alue
sSQL = Replace(sSQL, "chr(38)", "&")
sSQL = Replace(sSQL, "chr(60)", "<")
On error Resume Next
cn.Execute(sSQL)
If Err.number <> 0 then
vNextLine = Chr(13) & Chr(10)
vTab = Chr(9)
szDisplayMessage = ""
szODBCError = ""
If Left(Err.description, 4) = "ODBC" Then ' Is this the generic ODBC Error Message?
szODBCError = vNextLine & Err.description
Else
If InStr(1, Err.description, cMessageStartChars) > 0 Then
nMessageStartPos = InStr(1, Err.description, cMessageStartChars) + Len(cMessageStartChars)
nMessageEndPos = InStr(1, Err.description, cMessageEndChars) - nMessageStartPos
szDisplayMessage = vNextLine & Mid(Err.description, nMessageStartPos, nMessageEndPos)
Else
nMessageStartPos = InStr(1, Err.description, cGenericMessageStartChars)
nMessageEndPos = InStr(1, Err.description, cGenericMessageEndChars) - nMessageStartPos
If nMessageEndPos < 1 Then
nMessageEndPos = Len(Err.description) - nMessageStartPos
End If
szDisplayMessage = vNextLine & Mid (Err.description, nMessageStartPos, nMessageEndPos)
End If
End If
If szDisplayMessage = "" Then
szDisplayMessage = szODBCError
End If
strXML = "<RESPONSE>"
strXML = strXML & "<UPDATE_RESULTS>" & szDisplayMessage & "</UPDATE_RESULTS>"
strXML = strXML & "</RESPONSE>"
Else
strXML = "<RESPONSE>"
strXML = strXML & "<UPDATE_RESULTS>Record Update Successful</UPDATE_RESULTS
>"
strXML = strXML & "</RESPONSE>"
End If
Set XMLDOM = Nothing
cn.Close
Set cn = nothing
Response.Write(strXML)
%>
Start Free Trial