FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveTouch Accessing a web service from FiveTouch !!!
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Accessing a web service from FiveTouch !!!
Posted: Thu Nov 26, 2015 11:45 AM
Thanks to Rafa Carmona here you have a working example of how to access a web service
using Harbour code and FiveTouch! :-)

This opens the door to manage any remote database (MySQL, SQL, etc) using a web service
which it is the advised way to do it :-)

Finally we can use any database engine from FiveTouch! Many thanks Rafa!!!

Code (fw): Select all Collapse
PROCEDURE test_htip()

   LOCAL oHttp, hQuery, cResponse

   hQUery := { => }
   hb_HCaseMatch( hQuery, .F. )

   oHttp := TIPClientHTTP():New( "http://adaptaproyectoserp.com.ve/webservices/client.php", .T. )
   hQuery[ "nombre" ]    := "THefull The BEST!"
   
   IF ! oHttp:open()
      ? "Error: oHttp:open(): " + oHttp:lastErrorMessage()
      RETURN
   ENDIF

   IF ! oHttp:post( hQuery )
      ? "Error: oHttp:post(): " + oHttp:lastErrorMessage()
   ENDIF

   cResponse  := oHttp:readAll()
   oHttp:close()

   Alert( cResponse )

   RETURN


regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 153
Joined: Tue Aug 05, 2014 09:48 AM
Re: Accessing a web service from FiveTouch !!!
Posted: Thu Nov 26, 2015 01:30 PM

Excellent, Good News

Regards, Greetings



Try FWH. You will enjoy it's simplicity and power.!
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Accessing a web service from FiveTouch !!!
Posted: Thu Nov 26, 2015 09:57 PM
Using it from FiveTouch for Android:



regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Accessing a web service from FiveTouch !!!
Posted: Tue Oct 16, 2018 09:34 PM

Antônio,
Could you build an small example of use MySql with FiveTouch ?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Accessing a web service from FiveTouch !!!
Posted: Wed Oct 31, 2018 04:53 PM

Vilian,

Simply call a remote PHP from FiveTouch, like in the above example, and use the MySQL returned value

You don't even need to build a web service in the server. Just simple PHP code to retrieve a MySQL field value and return it

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion