I must communicate with website. I think the web service is way to do.
Where do I start?
I try but not successful. It show error
Application
===========
Path and name: d:\FWH1901\samples\testws.exe (32 bits)
Size: 3,732,480 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20180609)
FiveWin version: FWH 18.10
C compiler version: Borland/Embarcadero C++ 7.3 (32-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 07/20/22, 16:42:18
Error description: Error MSXML2.XMLHTTP/3 DISP_E_MEMBERNOTFOUND: SEND
Args:
[ 1] = C
- Code: Select all Expand view RUN
- #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
Thank in advance for any idea.