CreateObject( "MSXML2.XMLHTTP" )

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby karinha » Wed Jan 20, 2021 1: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
User avatar
karinha
 
Posts: 7834
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby Silvio.Falconi » Wed Jan 20, 2021 8: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7072
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby Giovany Vecchi » 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. )
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby karinha » Thu Jan 21, 2021 1: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: Select all  Expand view  RUN

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

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby Otto » Thu Jan 21, 2021 7:49 am

Thank you, João. Your code is working fine here.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6343
Joined: Fri Oct 07, 2005 7:07 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby Silvio.Falconi » Thu Jan 21, 2021 8: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7072
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby Silvio.Falconi » Thu Jan 21, 2021 8: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7072
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby Otto » Thu Jan 21, 2021 8: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6343
Joined: Fri Oct 07, 2005 7:07 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby Silvio.Falconi » Thu Jan 21, 2021 9: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: Select all  Expand view  RUN
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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7072
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby karinha » Thu Jan 21, 2021 11:08 am

Compile con: -w3 -es2

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

Code: Select all  Expand view  RUN

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

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby Otto » 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: Select all  Expand view  RUN

<!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
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6343
Joined: Fri Oct 07, 2005 7:07 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby Silvio.Falconi » Thu Jan 21, 2021 1:05 pm

karinha wrote:Compile con: -w3 -es2

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

Code: Select all  Expand view  RUN

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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7072
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby Giovany Vecchi » Thu Jan 21, 2021 1:08 pm

In some versions of windows as an example: SEVEN SP1 and XP I solved the problem including SETTIMEOUTS.

Code: Select all  Expand view  RUN

oServer := CreateObject( "MSXML2.ServerXMLHTTP.6.0" )
oServer:SetTimeouts(40000,40000,40000,40000)
 
User avatar
Giovany Vecchi
 
Posts: 223
Joined: Mon Jun 05, 2006 9:39 pm
Location: Brasil

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby karinha » Thu Jan 21, 2021 1: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
User avatar
karinha
 
Posts: 7834
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: CreateObject( "MSXML2.XMLHTTP" )

Postby karinha » Thu Jan 21, 2021 2:15 pm

Code: Select all  Expand view  RUN

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

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Surasak and 68 guests