Accessing a web service from FiveTouch !!!

Post Reply
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Accessing a web service from FiveTouch !!!

Post 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

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
bpd2000
Posts: 153
Joined: Tue Aug 05, 2014 9:48 am
Location: India

Re: Accessing a web service from FiveTouch !!!

Post by bpd2000 »

Excellent, Good News
Regards, Greetings

Try FWH. You will enjoy it's simplicity and power.!
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Accessing a web service from FiveTouch !!!

Post by Antonio Linares »

Using it from FiveTouch for Android:

Image

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Accessing a web service from FiveTouch !!!

Post by vilian »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Accessing a web service from FiveTouch !!!

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply