webservice implementation using php

User avatar
Lailton
Posts: 99
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil
Contact:

Re: webservice implementation using php

Post 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
Regards,
Lailton Fernando Mariano
https://www.harbour.ninja
User avatar
gabrielgaspar.dev
Posts: 4
Joined: Thu Mar 28, 2019 1:35 pm
Location: SC, Brasil

Re: webservice implementation using php

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

Re: webservice implementation using php

Post 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.
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: webservice implementation using php

Post 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?
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
gabrielgaspar.dev
Posts: 4
Joined: Thu Mar 28, 2019 1:35 pm
Location: SC, Brasil

Re: webservice implementation using php

Post 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?
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: webservice implementation using php

Post by cnavarro »

Surely the best tool is CURL but my experience with CreateObject is also very good and I have not had any problems
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
shri_fwh
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: webservice implementation using php

Post 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
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
Post Reply