error on createobject

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

error on createobject

Post by Silvio.Falconi »

function ReadMessage()
local HData,cr
local odoc := CreateObject( "MSXML2.DOMDocument" )
local ohttp := CreateObject( "MSXML2.XMLHTTP" )
local cTOKEN:="1206646388:AAEr-QL8hSYNAJ3dNx2k6w7u0nEAOWld2Po"
local URL:="https://api.telegram.org/bot"+cTOKEN+"/getUpdates"

ohttp:Open( "POST" ,URL, .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)

if oHttp:status==200
....
endif
return nil


give me error on bold line

the error

Code: Select all

Application
===========
   Path and name: C:\Work\Errori\Telegram_forum\test2.Exe (32 bits)
   Size: 4,013,568 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/16/21, 12:58:06
   Error description: (DOS Error -2147352567) WINOLE/1007  Download della risorsa specificata non riuscito.
 (0x800C0008): msxml3.dll
   Args:
     [   1] = C   

Stack Calls
===========
   Called from:  => TOLEAUTO:SEND( 0 )
   Called from: test2.prg => READMESSAGE( 104 )
 
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
AntoninoP
Posts: 347
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy
Contact:

Re: error on createobject

Post by AntoninoP »

I am not sure it is the error, but on header you send Content-type equals application/json then send an xml.
Why you load an xml inside a document then send the xml properties instead of send your xml directly?
The xml is only

Code: Select all

<?xml version=""1.0"" encoding=""utf-8""?>"
?
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: error on createobject

Post by Silvio.Falconi »

AntoninoP wrote:I am not sure it is the error, but on header you send Content-type equals application/json then send an xml.
Why you load an xml inside a document then send the xml properties instead of send your xml directly?
The xml is only

Code: Select all

<?xml version=""1.0"" encoding=""utf-8""?>"
?
on win 10 run ok
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply