FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour CreateObject( "MSXML2.XMLHTTP" )
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Wed Jan 20, 2021 01:55 AM

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 - Phone: +55(11)95150-7341
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Wed Jan 20, 2021 08:39 AM

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

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 244
Joined: Mon Jun 05, 2006 09:39 PM

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 12:31 AM

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. )

Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 01:59 AM
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 (fw): Select all Collapse
#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 - Phone: +55(11)95150-7341
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 07:49 AM

Thank you, João. Your code is working fine here.
Best regards,
Otto

Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 08:06 AM

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 ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 08:10 AM
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 ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: CreateObject( "MSXML2.XMLHTTP" )

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

https://support.microsoft.com/en-us/windows/windows-7-support-ended-on-january-14-2020-b75d4580-2cc7-895a-2c9c-1466d9a53962

Best regards,
Otto
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 09:22 AM
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/windows/windows-7-support-ended-on-january-14-2020-b75d4580-2cc7-895a-2c9c-1466d9a53962

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 (fw): Select all Collapse
Error description: (DOS Error -2147352567) WINOLE/1007  Download della risorsa specificata non riuscito.
 (0x800C0008): msxml3.dll
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 11:08 AM
Compile con: -w3 -es2

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

Code (fw): Select all Collapse
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/automatically-repair-windows-errors/?error=DLL%20File%20Errors&gclid=CjwKCAiA6aSABhApEiwA6Cbm____18ORQFVSOXeRzMLga4u68HeEhTPhJG56wA8y5LGUk5s9WNgpRBoCv8AQAvD_BwE

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Thu Jan 21, 2021 12:17 PM
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 (fw): Select all Collapse
<!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>
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

Re: CreateObject( &quot;MSXML2.XMLHTTP&quot; )

Posted: Thu Jan 21, 2021 01:05 PM
karinha wrote:Compile con: -w3 -es2

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

Code (fw): Select all Collapse
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/automatically-repair-windows-errors/?error=DLL%20File%20Errors&gclid=CjwKCAiA6aSABhApEiwA6Cbm____18ORQFVSOXeRzMLga4u68HeEhTPhJG56wA8y5LGUk5s9WNgpRBoCv8AQAvD_BwE

Regards.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 244
Joined: Mon Jun 05, 2006 09:39 PM

Re: CreateObject( &quot;MSXML2.XMLHTTP&quot; )

Posted: Thu Jan 21, 2021 01:08 PM
In some versions of windows as an example: SEVEN SP1 and XP I solved the problem including SETTIMEOUTS.

Code (fw): Select all Collapse
oServer := CreateObject( "MSXML2.ServerXMLHTTP.6.0" )
oServer:SetTimeouts(40000,40000,40000,40000)
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM

Re: CreateObject( &quot;MSXML2.XMLHTTP&quot; )

Posted: Thu Jan 21, 2021 01:48 PM
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 - Phone: +55(11)95150-7341
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM

Re: CreateObject( &quot;MSXML2.XMLHTTP&quot; )

Posted: Thu Jan 21, 2021 02:15 PM
Code (fw): Select all Collapse
// \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 - Phone: +55(11)95150-7341