CreateObject( "MSXML2.XMLHTTP" )

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

CreateObject( "MSXML2.XMLHTTP" )

Post by Silvio.Falconi »

I tried a test of Nageswarao

http://forums.fivetechsupport.com/viewt ... et#p191101

Code: Select all

   #include "fivewin.ch"

    REQUEST DBFCDX

    function Main()

       local odoc  := CreateObject( "MSXML2.DOMDocument" )
       local ohttp := CreateObject( "MSXML2.XMLHTTP" )
       local strret

       ohttp:Open( "GET" ,"http://www.w3schools.com/angular/customers.php", .F. )
       ohttp:SetRequestHeader( "Accept"        , "application/xml")
       ohttp:SetRequestHeader( "Content-Type" ,"application/json" )
       oDoc:async := .f.
       oDoc:LoadXml('<?xml version=""1.0"" encoding=""utf-8""?>')
       ohttp:Send(oDoc:xml)
       strret := alltrim(ohttp:responseText)

       ? StrRet

    //   StrToHashArray( StrRet )
       SaveToDBF( StrRet )

    return nil

    function SaveToDBF( cStr )

       local hData

       cStr  := CharRepl( "[]", RangeRem( 1, 31, cStr ), "{}" )
       do while '" :' $ cStr
          StrTran( cStr, '" :', '":' )
       enddo
       cStr  := StrTran( cStr, '":', '"=>' )

       hData := &cStr

       if File( "download.dbf" )
          USE download.dbf NEW ALIAS DST EXCLUSIVE VIA "DBFCDX"
       else
          DBCREATE( "download.dbf", { { "NAME",    'C', 40, 0 }, ;
                                      { "CITY",    'C', 40, 0 }, ;
                                      { "COUNTRY", 'C', 40, 0 } }, ;
                    "DBFCDX", .t., "DST" )
       endif

       AEval( HGetValueAt( hData, 1 ), { |h| DBAPPEND(), FW_HashToRec( h ) } )

       XBROWSER

       CLOSE DST

    return nil


On windows 10 run ok
On Windows Seven I have this error

Code: Select all

Application
===========
   Path and name: C:\Work\Errori\CREATE_OBJE_OLE\test.Exe (32 bits)
   Size: 4,072,448 bytes
   Compiler version: Harbour 3.2.0dev (r1904111533)
   FiveWin  version: FWH 20.12
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.1, Build 7600 

   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 01/18/21, 02:24:40
   Error description: (DOS Error -2147352567) WINOLE/1007  Accesso negato.
 (0x80070005): msxml3.dll
   Args:
     [   1] = C   

Stack Calls
===========
   Called from:  => TOLEAUTO:SEND( 0 )
   Called from: test.prg => MAIN( 16 )


I checked and I have this msxml3.dll on my system on c:\windows\system32 folder

How I can resolve it ?
Last edited by Silvio.Falconi on Mon Jan 18, 2021 12:31 pm, edited 1 time in total.
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 »

Code: Select all

      #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!')
            exit
         End

      #ENDIF

      Try
         oServer:Open( "GET", URL_CONSULTA, .f. )
         oServer:SetRequestHeader( "Content-Type", "application/x-www-form-urlencoded" )
         oServer:SetRequestHeader( "Connection", "keep-alive" )
         oServer:Send()
         oServer:WaitForResponse( 10000 )
      Catch
         MsgInfo('Erro na conexão com o site!', 'Atenção!')
         exit
      End
 
João Santos - São Paulo - Brasil
AntoninoP
Posts: 347
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: CreateObject( "MSXML2.XMLHTTP" )

Post by AntoninoP »

are you sure that is

Code: Select all

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

Code: Select all

ohttp:Open( "GET" ,"https://www.w3schools.com/angular/customers.php", .F. )
with https?
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Post by Silvio.Falconi »

AntoninoP wrote:are you sure that is

Code: Select all

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

Code: Select all

ohttp:Open( "GET" ,"https://www.w3schools.com/angular/customers.php", .F. )
with https?
I tried the test of Nages and on Win10 run , on win 7 no
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 »

karinha wrote:

Code: Select all

      #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!')
            exit
         End

      #ENDIF

      Try
         oServer:Open( "GET", URL_CONSULTA, .f. )
         oServer:SetRequestHeader( "Content-Type", "application/x-www-form-urlencoded" )
         oServer:SetRequestHeader( "Connection", "keep-alive" )
         oServer:Send()
         oServer:WaitForResponse( 10000 )
      Catch
         MsgInfo('Erro na conexão com o site!', 'Atenção!')
         exit
      End
 
????????

not run
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 »

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 »

on win 7not 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 »

i formatted and reinstalled all computer
i have with windows seven 64bit and still can't get this Nages example working still i have the same problem

Code: Select all

Application
===========
   Path and name: C:\work\errori\Nages_create_ole\test.Exe (32 bits)
   Size: 4,072,448 bytes
   Compiler version: Harbour 3.2.0dev (r1904111533)
   FiveWin  version: FWH 20.12
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.1, Build 7600 

   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 01/19/21, 11:27:44
   Error description: (DOS Error -2147352567) WINOLE/1007  Accesso negato.
 (0x80070005): msxml3.dll
   Args:
     [   1] = C   

Stack Calls
===========
   Called from:  => TOLEAUTO:SEND( 0 )
   Called from: test.prg => MAIN( 16 )

can you explain me how to solve this problem?
Last edited by Silvio.Falconi on Tue Jan 19, 2021 10:44 am, edited 1 time in total.
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 »

Do try turning off UAC and see if that resolves the issue. The issue appears to be permissions, and UAC just might be getting in the way.
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 »

karinha wrote:Do try turning off UAC and see if that resolves the issue. The issue appears to be permissions, and UAC just might be getting in the way.
UAC ? where ?
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 »

Silvio.Falconi wrote:
karinha wrote:Do try turning off UAC and see if that resolves the issue. The issue appears to be permissions, and UAC just might be getting in the way.
UAC ? where ?
https://docs.microsoft.com/en-us/window ... trol-works

https://social.technet.microsoft.com/wi ... ws-10.aspx

Regards.
João Santos - São Paulo - Brasil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: CreateObject( "MSXML2.XMLHTTP" )

Post by Antonio Linares »

https://www.lifewire.com/how-to-fix-msx ... rs-2623821
Clean the Windows registry. Use a free Windows registry cleaner to remove invalid msxml3.dll registry entries that might be causing the error.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Post by Silvio.Falconi »

karinha wrote:
Silvio.Falconi wrote:
karinha wrote:Do try turning off UAC and see if that resolves the issue. The issue appears to be permissions, and UAC just might be getting in the way.
UAC ? where ?
https://docs.microsoft.com/en-us/window ... trol-works

https://social.technet.microsoft.com/wi ... ws-10.aspx

Regards.
ALL THIS DOCUMENTS YOU SENT ME ARE FOR WINDOWS 10

I HAVE PROBLEM WITH A COMPUTER HAVING WINDOWS SEVEN
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: CreateObject( "MSXML2.XMLHTTP" )

Post by Antonio Linares »

> I HAVE PROBLEM WITH A COMPUTER HAVING WINDOWS SEVEN

Update it to Windows 10 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: CreateObject( "MSXML2.XMLHTTP" )

Post by Silvio.Falconi »

Antonio Linares wrote:> I HAVE PROBLEM WITH A COMPUTER HAVING WINDOWS SEVEN

Update it to Windows 10 :-)
I cannot upgrade to win10 that pc
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply