Page 1 of 1

Accessing a web service from FiveTouch !!!

PostPosted: Thu Nov 26, 2015 11:45 am
by Antonio Linares
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: Select all  Expand view
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


Image

Re: Accessing a web service from FiveTouch !!!

PostPosted: Thu Nov 26, 2015 1:30 pm
by bpd2000
Excellent, Good News

Re: Accessing a web service from FiveTouch !!!

PostPosted: Thu Nov 26, 2015 9:57 pm
by Antonio Linares
Using it from FiveTouch for Android:

Image

Image

Re: Accessing a web service from FiveTouch !!!

PostPosted: Tue Oct 16, 2018 9:34 pm
by vilian
Antônio,
Could you build an small example of use MySql with FiveTouch ?

Re: Accessing a web service from FiveTouch !!!

PostPosted: Wed Oct 31, 2018 4:53 pm
by Antonio Linares
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