error on createobject

error on createobject

Postby Silvio.Falconi » Sat Jan 16, 2021 12:11 pm

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  Expand view
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 )
 
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: 6848
Joined: Thu Oct 18, 2012 7:17 pm

Re: error on createobject

Postby AntoninoP » Mon Jan 18, 2021 7:38 am

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  Expand view
<?xml version=""1.0"" encoding=""utf-8""?>"
?
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: error on createobject

Postby Silvio.Falconi » Mon Jan 18, 2021 7:45 am

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  Expand view
<?xml version=""1.0"" encoding=""utf-8""?>"
?


on win 10 run ok
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: 6848
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 45 guests