Page 2 of 3

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Wed Jan 20, 2021 1:55 am
by karinha
Format and install windows 7 32 bit that will work. Mine is windows 7 32 bit professional.

If it is not difficult, it is not Silvio Falconi. hahahahahahaha.

Just playing with you.

Regards, saludos.

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Wed Jan 20, 2021 8:39 am
by Silvio.Falconi
there is something wrong because using hbcurl lib I can see what is on that url, so there is a bug on createobject...on win 7

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 12:31 am
by Giovany Vecchi
In several cases when sending content the correct POST would be
Try like this:

ohttp:Open( "POST" ,"http://www.w3schools.com/angular/customers.php", .F. )

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 1:59 am
by karinha
Giovany Vecchi wrote:In several cases when sending content the correct POST would be
Try like this:

ohttp:Open( "POST" ,"http://www.w3schools.com/angular/customers.php", .F. )

Code: Select all

#include "FiveWin.ch"

#Define cUrl                  "http://www.w3schools.com/angular/customers.php"

FUNCTION Main()

   LOCAL cHtml, oServer, cStringCookie

   #ifdef __XHARBOUR__  // xHarbour

      Try

         oServer := CreateObject( "MSXML2.ServerXMLHTTP.6.0" )

      Catch

         MsgInfo( 'Erro na Criação do Serviço' )

         RETURN NIL

      End

   #else

      Try

         oServer := win_OleCreateObject( "MSXML2.ServerXMLHTTP.5.0" )

      Catch

         MsgInfo( 'Erro na Criação do Serviço!', 'Atenção!' )

         RETURN NIL

      End

   #endif

   Try

      oServer:Open( "POST", cUrl, .F. )

   Catch

      MsgInfo( 'Erro na Conexão com o Site ' + cUrl )

      RETURN .F.

   End

   oServer:SetRequestHeader( "Content-Type", "application/x-www-form-urlencoded" )
   oServer:SetRequestHeader( "Connection", "keep-alive" )

   Try

      oServer:Send()
      oServer:WaitForResponse( 500000 )

   Catch

      MsgInfo( 'Erro na Resposta com o Site ' + cUrl )

      RETURN( .F. )

   End

   cHtml := oServer:ResponseBody

   cStringCookie := oServer:getResponseHeader("Set-Cookie")

   MemoWrit( 'SiteA.txt', cHtml )

   xBrowse( "SiteA.txt" )

RETURN NIL
 

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 7:49 am
by Otto
Thank you, João. Your code is working fine here.
Best regards,
Otto

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 8:06 am
by Silvio.Falconi
I Installed on this computer ( Windows Seven Home) Server Pack 1 and also not run, same error


I wish ask You a question....

Why if I use hbcurl functions it run ?

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 8:10 am
by Silvio.Falconi
Otto wrote:Thank you, João. Your code is working fine here.
Best regards,
Otto
do you are trying it on Windows Seven Home 64 bit ?

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 8:55 am
by Otto
Silvio,
No, I tested with WINDOWS 10. But the initial sample didn't work. Now all works fine.

https://support.microsoft.com/en-us/win ... 66d9a53962

Best regards,
Otto

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 9:22 am
by Silvio.Falconi
Otto wrote:Silvio,
No, I tested with WINDOWS 10. But the initial sample didn't work. Now all works fine.

https://support.microsoft.com/en-us/win ... 66d9a53962

Best regards,
Otto
As I have already explained to Antonio Linares, I have to use this computer with Windows Seven Home Sp1, I cannot upgrade it to Windows 10 because this computer is in the presidency, this computer is used by the Headmaster of my school, and in this computer he also has others software not working under windows 10,
so I have to find other solutions.
But the problem remains, probably the Create Object command has a bug because in windows Seven Home premium it makes this error

Code: Select all

Error description: (DOS Error -2147352567) WINOLE/1007  Download della risorsa specificata non riuscito.
 (0x800C0008): msxml3.dll

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 11:08 am
by karinha
Compile con: -w3 -es2

Mira tu Windows 7 64 bits, se está asi:

Code: Select all

c:\Windows\System32\msxml3.dll
c:\Windows\System32\msxml3r.dll
c:\Windows\System32\msxml6.dll
c:\Windows\System32\msxml6r.dll

c:\Windows\SysWOW64\msxml3.dll
c:\Windows\SysWOW64\msxml3r.dll
c:\Windows\SysWOW64\msxml6.dll
c:\Windows\SysWOW64\msxml6r.dll
 
https://certified.windowserrorhelp.com/ ... 8AQAvD_BwE

Regards.

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 12:17 pm
by Otto
Hello Silvio,
Can you use a web server on the WINDOWS 7 PC_
You could then call the localhost silently and save the response XML 'file and then read it with memoread.
If you can install mod harbour, you can create the DBF file immediately.
Best regards,

Otto

http://localhost/silvio/index.html

Code: Select all

<!DOCTYPE html>
<html lang="de">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>

<body>
    <script>
        const http = new XMLHttpRequest()
        const url = "https://www.w3schools.com/angular/customers.php";
        
        http.open('get', url, true);
        http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
        http.onload = function () {
            if(http.status === 200 || http.status == 0) {
                alert("succeed")
                console.log(http.responseText);
                alert( http.responseText )
            }
        }
        http.onerror = function () {         
            alert("failed")
        };
        http.send();
        
    </script>
    
</body>
</html>
 

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 1:05 pm
by Silvio.Falconi
karinha wrote:Compile con: -w3 -es2

Mira tu Windows 7 64 bits, se está asi:

Code: Select all

c:\Windows\System32\msxml3.dll
c:\Windows\System32\msxml3r.dll
c:\Windows\System32\msxml6.dll
c:\Windows\System32\msxml6r.dll

c:\Windows\SysWOW64\msxml3.dll
c:\Windows\SysWOW64\msxml3r.dll
c:\Windows\SysWOW64\msxml6.dll
c:\Windows\SysWOW64\msxml6r.dll
 

with payment I not have money
https://certified.windowserrorhelp.com/ ... 8AQAvD_BwE

Regards.

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 1:08 pm
by Giovany Vecchi
In some versions of windows as an example: SEVEN SP1 and XP I solved the problem including SETTIMEOUTS.

Code: Select all

oServer := CreateObject( "MSXML2.ServerXMLHTTP.6.0" )
oServer:SetTimeouts(40000,40000,40000,40000)
 

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 1:48 pm
by karinha
Silvio:
with payment I not have money

Silvio, you don't fool me. I know you are very rich. hahahahahahaha.

Regards.

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 2:15 pm
by karinha

Code: Select all

// \SAMPLES\NAGES2.PRG

#include "FiveWin.ch"

#define cUrl                  "http://www.w3schools.com/angular/customers.php"

FUNCTION Main()

   LOCAL cHtml, oServer, cStringCookie

   #ifdef __XHARBOUR__  // xHarbour

      Try

         oServer := CreateObject( "MSXML2.ServerXMLHTTP.6.0" )

         oServer:SetTimeouts(40000,40000,40000,40000)

      Catch

         MsgInfo( 'Erro na Criação do Serviço' )

         RETURN NIL

      End

   #else

      Try

         oServer := win_OleCreateObject( "MSXML2.ServerXMLHTTP.5.0" )

         oServer:SetTimeouts(40000,40000,40000,40000)

      Catch

         MsgInfo( 'Erro na Criação do Serviço!', 'Atenção!' )

         RETURN NIL

      End

   #endif

   Try

      oServer:Open( "POST", cUrl, .F. )

   Catch

      MsgInfo( 'Erro na Conexão com o Site ' + cUrl )

      RETURN .F.

   End

   oServer:SetRequestHeader( "Content-Type", "application/x-www-form-urlencoded" )
   oServer:SetRequestHeader( "Connection", "keep-alive" )

   Try

      oServer:Send()
      oServer:WaitForResponse( 500000 )

   Catch

      MsgInfo( 'Erro na Resposta com o Site ' + cUrl )

      RETURN( .F. )

   End

   cHtml := oServer:ResponseBody

   cStringCookie := oServer:getResponseHeader("Set-Cookie")

   MemoWrit( 'SiteA.txt', cHtml )

   xBrowse( "SiteA.txt" )

RETURN NIL