Accessing a web service from FiveTouch !!!

Accessing a web service from FiveTouch !!!

Postby Antonio Linares » 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: 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Accessing a web service from FiveTouch !!!

Postby bpd2000 » Thu Nov 26, 2015 1:30 pm

Excellent, Good News
Regards, Greetings

Try FWH. You will enjoy it's simplicity and power.!
User avatar
bpd2000
 
Posts: 153
Joined: Tue Aug 05, 2014 9:48 am
Location: India

Re: Accessing a web service from FiveTouch !!!

Postby Antonio Linares » Thu Nov 26, 2015 9:57 pm

Using it from FiveTouch for Android:

Image

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Accessing a web service from FiveTouch !!!

Postby vilian » Tue Oct 16, 2018 9: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
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Accessing a web service from FiveTouch !!!

Postby Antonio Linares » Wed Oct 31, 2018 4: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveTouch

Who is online

Users browsing this forum: No registered users and 1 guest