Page 1 of 3

CreateObject( "MSXML2.XMLHTTP" )

Posted: Mon Jan 18, 2021 1:27 am
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 ?

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Mon Jan 18, 2021 1:55 am
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
 

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Mon Jan 18, 2021 7:34 am
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?

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Mon Jan 18, 2021 7:40 am
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

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Mon Jan 18, 2021 7:44 am
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

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Mon Jan 18, 2021 2:13 pm
by karinha

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Mon Jan 18, 2021 2:23 pm
by Silvio.Falconi
on win 7not run

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Tue Jan 19, 2021 10:30 am
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?

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Tue Jan 19, 2021 10:44 am
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.

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Tue Jan 19, 2021 11:15 am
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 ?

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Tue Jan 19, 2021 12:02 pm
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.

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Tue Jan 19, 2021 12:04 pm
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.

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Tue Jan 19, 2021 12:16 pm
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

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Tue Jan 19, 2021 12:21 pm
by Antonio Linares
> I HAVE PROBLEM WITH A COMPUTER HAVING WINDOWS SEVEN

Update it to Windows 10 :-)

Re: CreateObject( "MSXML2.XMLHTTP" )

Posted: Tue Jan 19, 2021 9:24 pm
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