Page 2 of 2

Re: webservice implementation using php

Posted: Fri Mar 29, 2019 3:13 am
by Lailton
If your question is how to access HTTPS with curl,

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

Code: Select all

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.

:D

Re: webservice implementation using php

Posted: Fri Mar 29, 2019 12:03 pm
by gabrielgaspar.dev
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: Select all

Error description: BASE / 1081 error Operation not supported: TIPCLIENTHTTP: New ()
    Args:
      [1] = O TIPCLIENTHTTP
      [2] = C https
 

Re: webservice implementation using php

Posted: Tue Apr 02, 2019 12:03 pm
by gabrielgaspar.dev
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.

Re: webservice implementation using php

Posted: Tue Apr 02, 2019 6:48 pm
by cnavarro
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?

Re: webservice implementation using php

Posted: Tue Apr 02, 2019 8:12 pm
by gabrielgaspar.dev
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?

Re: webservice implementation using php

Posted: Tue Apr 02, 2019 8:40 pm
by cnavarro
Surely the best tool is CURL but my experience with CreateObject is also very good and I have not had any problems

Re: webservice implementation using php

Posted: Wed Apr 03, 2019 9:26 am
by shri_fwh
Dear All ,

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

Code: Select all


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


 


Thanks
Shridhar