webservice implementation using php

Re: webservice implementation using php

Postby Lailton » Fri Mar 29, 2019 3: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: Select all  Expand view
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
Regards,
Lailton Fernando Mariano
User avatar
Lailton
 
Posts: 153
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil

Re: webservice implementation using php

Postby gabrielgaspar.dev » 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: Select all  Expand view

Error description: BASE / 1081 error Operation not supported: TIPCLIENTHTTP: New ()
    Args:
      [1] = O TIPCLIENTHTTP
      [2] = C https
 
User avatar
gabrielgaspar.dev
 
Posts: 4
Joined: Thu Mar 28, 2019 1:35 pm
Location: SC, Brasil

Re: webservice implementation using php

Postby gabrielgaspar.dev » 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.
User avatar
gabrielgaspar.dev
 
Posts: 4
Joined: Thu Mar 28, 2019 1:35 pm
Location: SC, Brasil

Re: webservice implementation using php

Postby cnavarro » Tue Apr 02, 2019 6: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: webservice implementation using php

Postby gabrielgaspar.dev » Tue Apr 02, 2019 8: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?
User avatar
gabrielgaspar.dev
 
Posts: 4
Joined: Thu Mar 28, 2019 1:35 pm
Location: SC, Brasil

Re: webservice implementation using php

Postby cnavarro » Tue Apr 02, 2019 8: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: webservice implementation using php

Postby shri_fwh » Wed Apr 03, 2019 9:26 am

Dear All ,

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

Code: Select all  Expand view


      // 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 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Marc Venken, Silvio.Falconi and 130 guests