d3vilseye
Goto Top

Problem beim Aufruf einer ASP Seite auf Windows Server 2008

Beim Aufruf einer ASP Seite auf Windows Server 2008 tritt derzeit ein Fehler auf "Microsoft VBScript runtime error '800a0005' " unter Windows Server 2003 läuft das Script hingegen reibungslos.

Hallo,

wir haben in unserem Unternehmen einen neuen Server mit Windows Server 2008 Betriebssystem.

Dabei tritt bei einem unserer Scripte derzeit ein Problem auf und wir erhalten die Fehlermeldung:

Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'Mid'
/_global/asp/rnd_project_product/rnd_project_product.asp, line 80

Bei der Analyse stellte sich heraus, dass der an eine Funktion übergebene Parameter keinen Wert enthält.

Hier ist das Script:

<%
Call StartJob()

Sub StartJob()

Dim objHttp
Dim strUrl
Dim strData
Dim strKeyRequest
Dim strKeyAwnser

' Create a HTTP instance
Set objHttp = CreateObject("Microsoft.XMLHTTP")

strUrl = "http://localhost:4720/qtxs.asmx"

strKeyRequest ="<Global method=""GetTimeLimitedRequestKey"" />"

objHttp.open "POST",strUrl,false
objHttp.setRequestHeader "Content-Type","text/xml"
objHttp.setRequestHeader "Content-Length", Len(strKeyRequest)
objHttp.Send strKeyRequest

'Parse the awnser
Dim strKey
strKey = ParseKeyAwnser(objHttp.ResponseText)


'Get the string to send in the request that triggers the task
Dim strTaskStatusString

strTaskName = Request.QueryString("taskname")
strTaskPassword = Request.QueryString("taskpassword")

Response.write(strTaskName & "<br>")
Response.write(strTaskPassword & "<br>")

strTaskStatusString = GetTaskStatusString(strKey,strTaskName,strTaskPassword)

Response.write(strTaskStatusString & "<br>")

'Do the actual request to trigger the task
objHttp.open "POST",strUrl,false
objHttp.setRequestHeader "Content-Type","text/xml"
objHttp.setRequestHeader "Content-Length", Len(strKeyRequest)
objHttp.Send strTaskStatusString

'Get the awnser, the awnser can contain different things but for now I only care to see if we find success
dim strAwnser
strAnwser = objHttp.ResponseText

Response.write(strAnwser & "<br>")

Response.write(ParseStatusAwnser(strAnwser) & "<br>")

Dim strTaskStartString
strTaskStartString = GetTaskStartString(strKey,strTaskName,strTaskPassword)

'Do the actual request to trigger the task
objHttp.open "POST",strUrl,false
objHttp.setRequestHeader "Content-Type","text/xml"
objHttp.setRequestHeader "Content-Length", Len(strKeyRequest)
objHttp.Send strTaskStartString

'Get the awnser, the awnser can contain different things but for now I only care to see if we find success
strAnwser = objHttp.ResponseText

End Sub

'Functions Section
Function ParseKeyAwnser(strKeyAwnser)
Dim intStartPos
Dim IntKeyLen

'Get the starting and the end position of the key
intStartPos = InStr(strKeyAwnser,"<GetTimeLimitedRequestKeyResult>")+Len("<GetTimeLimitedRequestKeyResult>")
intKeyLen = InStrRev(strKeyAwnser,"</GetTimeLimitedRequestKeyResult>") - intStartPos

'Get and return the key
ParseKeyAwnser = Mid(strKeyAwnser,intStartPos,intKeyLen)

End Function

Function ParseStatusAwnser(strKeyAwnser)

Dim intStartPos
Dim IntKeyLen
Dim strFinalLog
Dim strCurrentStatus
Dim strDoAlert

'Get the starting and the end position of the Status Key
intStartPos = InStr(strKeyAwnser,"<Status>")+Len("<Status>")
intKeyLen = InStrRev(strKeyAwnser,"</Status>") - intStartPos

strCurrentStatus = Mid(strKeyAwnser,intStartPos,intKeyLen)

If strCurrentStatus = "Running" Then
strFinalLog = "Not Available"
Else
'Get the starting and the end position of the Log Key
intStartPos = InStr(strKeyAwnser,"<LastLogMsg>")+Len("<LastLogMsg>")
intKeyLen = InStrRev(strKeyAwnser,"</LastLogMsg>") - intStartPos

strFinalLog = Mid(strKeyAwnser,intStartPos,intKeyLen)
End If

'Get the starting and the end position of the Do Alert Key
intStartPos = InStr(strKeyAwnser,"<DoAlert>")+Len("<DoAlert>")
intKeyLen = InStrRev(strKeyAwnser,"</DoAlert>") - intStartPos

strDoAlert = Mid(strKeyAwnser,intStartPos,intKeyLen)

'Get and return the key
ParseStatusAwnser = "Current Status is: " & strCurrentStatus & " and the Do Alert is " & strDoAlert

End Function

Function GetTaskStatusString(strRequestKey,strTaskName,strTaskPassword)
'Make the string and insert the key
GetTaskStatusString = "<Global method=""GetTaskStatus"" key=""" & strRequestKey & """><TaskNameOrId>" & strTaskName & "</TaskNameOrId></Global>"
End Function

Function GetTaskStartString(strRequestKey,strTaskName,strTaskPassword)
'Make the string and insert the key
GetTaskStartString = "<Global method=""RequestEDX"" key=""" & strRequestKey & """><i_TaskIDOrTaskName>" & strTaskName & "</i_TaskIDOrTaskName><i_Password>" & strTaskPassword & "</i_Password><i_VariableName /><i_VariableValueList /></Global>"
End Function

%>


Anscheinend liefert objHttp.ResponseText keinen Wert auf dem neuen Server, was zu einem Fehler in der Funktion ParseKeyAwnser führt.

Hat vielleicht jemand eine Idee, was die Ursache sein könnte.

Ich bin leider nicht so fit in der ASP Entwicklung.

Content-Key: 173322

Url: https://administrator.de/contentid/173322

Printed on: April 19, 2024 at 08:04 o'clock