Jump to content

WinHTTP .Send not working?


Recommended Posts

Hi,

Since this week my script broke and I don't know why.
Could it be because silently they updated IE to v.11.1358.xxx
Are there any other things I could try?

I get an error [80020006] on line .
Is .send not valid anymore?

Dim $hSend = $oHTTP.Send()

 

Here's more of the script.
The URL is valid. I checked it manually.

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

    Dim $hOpen = $oHTTP.Open("GET", $BulkMut_ServerURL, False)
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $BulkMut_ServerURL = ' & $BulkMut_ServerURL & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hOpen = ' & $hOpen & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

    $oHTTP.SetCredentials(@UserName, $OMSww, 0)
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : @UserName = ' & @UserName & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
    Dim $hSend = $oHTTP.Send()
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hSend = ' & $hSend & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console

    ProgressSet(0, "", "Link datum ophalen.")

    $oHTTPText = $oHTTP.ResponseText

 

Link to comment
Share on other sites

back to the helpfile / back to basic, but without any luck.
Tried the help file code and it gives me an error also.

PLEASE HELP, I'm going to panic.
I have a handfull of scripts that used to make my life easier....
Now I have to do it all by hand again!  :(

 

From the helpfile:

Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "http://www.AutoItScript.com")
$oHTTP.Send()
$HTMLSource = $oHTTP.Responsetext

 

Error in SciTE editor

>"H:\PortableApps\AutoIt\install\SciTE4AutoIt3_Portable\..\AutoIt3.exe" "H:\PortableApps\AutoIt\install\SciTE4AutoIt3_Portable\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "H:\Mijn Dokumenten\Scripts\WinHHTP_brugbart.au3" /UserParams    
+>15:14:05 Starting AutoIt3Wrapper v.16.306.1237.0 SciTE v.3.6.2.0   Keyboard:00020409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0413)  CodePage:0  utf8.auto.check:4    # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM
+>         SciTEDir => H:\PortableApps\AutoIt\install\SciTE4AutoIt3_Portable   UserDir => H:\PortableApps\AutoIt\install\SciTE4AutoIt3_Portable\AutoIt3Wrapper
>Running AU3Check (3.3.14.2)  from:H:\PortableApps\AutoIt\install  input:H:\Mijn Dokumenten\Scripts\WinHHTP_brugbart.au3
+>15:14:05 AU3Check ended.rc:0
>Running:(3.3.14.2):H:\PortableApps\AutoIt\install\autoit3_x64.exe "H:\Mijn Dokumenten\Scripts\WinHHTP_brugbart.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
"H:\Mijn Dokumenten\Scripts\WinHHTP_brugbart.au3" (3) : ==> The requested action with this object has failed.:
$oHTTP.Send()
$oHTTP^ ERROR
->15:14:05 AutoIt3.exe ended.rc:1
+>15:14:05 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 0.7544

 

 

 

Link to comment
Share on other sites

Oh my bad, I didn't notice it was WinHTTP. Regardless yes you can still use the error handler, you just have to set it with ObjEvent(). Then use this handler:

; User's COM error function.
; After SetUp with ObjEvent("AutoIt.Error", ....) will be called if COM error occurs
Func _User_ErrFunc($oError)
    ; Do anything here.
    ConsoleWrite(@ScriptFullPath & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _
            @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _
            @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
            @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _
            @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _
            @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
            @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
            @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
            @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
            @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF)
EndFunc   ;==>_User_ErrFunc

 

UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Link to comment
Share on other sites

2 hours ago, anthonyjr2 said:

Also you said that even the helpfile example didn't help you? Because that seems to be working fine for me.

Yes, it was for me too.

Until yesterday. 

But I suspect the problem lies in windows (winhttp.dll) 

I was hoping it was not! :(

Don't know how to fix that. Also, I have no admin rights here at work.

I'll test the error handler later and post back.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...