Hi all, I have a laptop with windows 32bit xp and I want to call a web service using a .vbs script, let it be https://www.testws.gr/sendMessages
I tried the following version
But I got errors as follow :
Microsoft.XMLHTTP
Error : System Error -2146697208
Code : 800C0008
Source : msxml3.ddl
MSXML2.XMLHTTP
Error : System Error -2146697208
Code : 800C0008
Source : msxml3.ddl
MSXML2.ServerXMLHTTP
Error : The message received was unexpected or badly formatted.
Code : 80090326
Source : msxml3.ddl
When I open the browser and clicked url the service responses to me with a format like Number1/Number2
such as 2/4.
So, I decided to create a shell for opening chrome , a shell for waiting and a shell for closing chrome browsers.
The above works as expected.
The problem I have is the following :
I would like to close after tab is completed loaded (without using miliseconds for waiting) and only the tab that is opened to be closed (not all the chromes windows)
Moreover is there any way to get the response ?
Thanks in advance for your help
I tried the following version
Code:
Dim xmlhttp, myurl
myurl = "https://www.testws.gr/sendMessages"
Set xmlhttp = CreateObject("Microsoft.XMLHTTP") 'Also tried "MSXML2.XMLHTTP" , "MSXML2.ServerXMLHTTP"
xmlhttp.Open "GET", myurl, False
xmlhttp.Send ""
'MsgBox(xmlhttp.responseText)
Microsoft.XMLHTTP
Error : System Error -2146697208
Code : 800C0008
Source : msxml3.ddl
MSXML2.XMLHTTP
Error : System Error -2146697208
Code : 800C0008
Source : msxml3.ddl
MSXML2.ServerXMLHTTP
Error : The message received was unexpected or badly formatted.
Code : 80090326
Source : msxml3.ddl
When I open the browser and clicked url the service responses to me with a format like Number1/Number2
such as 2/4.
So, I decided to create a shell for opening chrome , a shell for waiting and a shell for closing chrome browsers.
Code:
function readFromRegistry (strRegistryKey, strDefault)
Dim WSHShell, value
On Error Resume Next
Set WSHShell = CreateObject ("WScript.Shell")
value = WSHShell.RegRead (strRegistryKey)
if err.number <> 0 then
readFromRegistry= strDefault
else
readFromRegistry=value
end if
set WSHShell = nothing
end function
function OpenWithChrome(strURL)
Dim strChrome
Dim WShellChrome
strChrome = readFromRegistry ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe\Path", "")
if (strChrome = "") then
strChrome = "Chrome.exe"
else
strChrome = strChrome & "\Chrome.exe"
end if
Set WShellChrome = CreateObject("WScript.Shell")
strChrome = """" & strChrome & """" & " " & strURL
WShellChrome.Run strChrome, 1, false
end function
function MySleep(milliseconds)
set WScriptShell = CreateObject("WScript.Shell")
WScriptShell.Run "Sleep -m " & milliseconds, 0, true
end Function
function closeChrome
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.Run "taskkill /f /t /im chrome.exe", 0, True
end Function
OpenWithChrome "https://www.testws.gr/sendMessages"
MySleep 60000 '60 secs
closeChrome
The problem I have is the following :
I would like to close after tab is completed loaded (without using miliseconds for waiting) and only the tab that is opened to be closed (not all the chromes windows)
Moreover is there any way to get the response ?
Thanks in advance for your help