FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour webservice implementation using php
Posts: 231
Joined: Fri Jul 20, 2012 01:49 AM
Re: webservice implementation using php
Posted: Fri Mar 29, 2019 03:13 AM
If your question is how to access HTTPS with curl,

If you HTTPS is an invalid certificate then you need set this:

Code (fw): Select all Collapse
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);


Otherwise you dont need change anything and it will works.

:-)
Regards,

Lailton Fernando Mariano
Posts: 4
Joined: Thu Mar 28, 2019 01:35 PM
Re: webservice implementation using php
Posted: Fri Mar 29, 2019 12:03 PM
Good Morning
Thank you for your attention
What I need is to use a webservice that works only with "https".
I'm testing with the TIpClientHttp class and with it I'm only able to access "http" webservices.
the error you present is this:

Code (fw): Select all Collapse
Error description: BASE / 1081 error Operation not supported: TIPCLIENTHTTP: New ()
    Args:
      [1] = O TIPCLIENTHTTP
      [2] = C https
Posts: 4
Joined: Thu Mar 28, 2019 01:35 PM
Re: webservice implementation using php
Posted: Tue Apr 02, 2019 12:03 PM
cnavarro wrote:You are welcome
Gabriel, explain better what you need


I researched and only found something about importing three libraries to xHarbour in order to enable access to APIs with "https". But I can not get these libraries and I do not understand how to imbibe them.
Another solution I found was the use of this object "CreateObject ('MSXML2.ServerXMLHTTP.6.0')", which until then worked with "https", but I have my doubts about the differences between this object and the TIpClientHttp class.

Who can help me to define the best option to consume API I thank you very much.
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: webservice implementation using php
Posted: Tue Apr 02, 2019 06:48 PM

Well, the best thing to do is to do it in Harbour, so you will not have trouble finding the libraries, or at least it will be easier, but in any case, doing it with CreateObject is a good solution to access a WebService.
What version of Fivewin do you use?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 4
Joined: Thu Mar 28, 2019 01:35 PM
Re: webservice implementation using php
Posted: Tue Apr 02, 2019 08:12 PM
cnavarro wrote:Well, the best thing to do is to do it in Harbour, so you will not have trouble finding the libraries, or at least it will be easier, but in any case, doing it with CreateObject is a good solution to access a WebService.
What version of Fivewin do you use?


I use the Fivewin 17.07.
Would I lose any function with this CreateObject?
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: webservice implementation using php
Posted: Tue Apr 02, 2019 08:40 PM

Surely the best tool is CURL but my experience with CreateObject is also very good and I have not had any problems

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: webservice implementation using php
Posted: Wed Apr 03, 2019 09:26 AM
Dear All ,

Is Any wrapper function exists to execute any kind of URL as given below ?

Code (fw): Select all Collapse
      // for JSON
      jsonData := ExecuteURL( cURL , aParams , "JSON" ) ;
     // for Image 
      oImg  := ExecuteURL( cURL , aParams , "IMG" ) ;
     // for String
      cStr1   := ExecuteURL( cURL , aParams , "STR" ) ;




Thanks
Shridhar
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB

Continue the discussion