CreateObject( "MSXML2.XMLHTTP" )

User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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.
João Santos - São Paulo - Brasil
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Giovany Vecchi
Posts: 129
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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. )
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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
 
João Santos - São Paulo - Brasil
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: CreateObject( "MSXML2.XMLHTTP" )

Post by Otto »

Thank you, João. Your code is working fine here.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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 ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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 ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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.
João Santos - São Paulo - Brasil
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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>
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Giovany Vecchi
Posts: 129
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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)
 
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: CreateObject( "MSXML2.XMLHTTP" )

Post by karinha »

Silvio:
with payment I not have money

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

Regards.
João Santos - São Paulo - Brasil
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: CreateObject( "MSXML2.XMLHTTP" )

Post 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
 
João Santos - São Paulo - Brasil
Post Reply