What are you using to make the web requests in VFP?
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Chris Davis Sent: Thursday, September 06, 2018 2:12 PM To: profoxtech@leafe.com Subject: Re: SOAP
Progress I have managed to use vfpoauth to get my access token now I need to work out how to sign a request in vfp , I can get it to work in postman
On 6 Sep 2018, at 19:01, Stephen Russell srussell705@gmail.com wrote:
This might help?
https://github.com/VFPX/VFPOAuth
On Thu, Sep 6, 2018 at 10:24 AM Chris Davis chrisd@actongate.co.uk wrote:
Thanks Stephen, I am struggling with oAuth at the moment, the documentation gives examples but obviously not in VFP and it looks like things like javascript and php include oauth modules.
So if I can reword my question, has anyone got any oauth code 😊
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Stephen Russell Sent: Thursday, 06 September 2018 15:20 To: profoxtech@leafe.com Subject: Re: SOAP
To be honest, REST is just a way that sets up an interaction in complex ways without the client knowing anything beforehand about the server and the resources it hosts. You define that the transmission is going to be HTTP and then follow the rules for it.
Now your call to the API can be done from a web browser, an app on a phone or a tablet.
here is something I wrote to get data for ExchangeRates. apicall.Clear(); // This is a string to hold the params for the call I am making for data
apicall.Append("api/historical/" + EOM);
apicall.Append(".json?app_id=bbfaf8b299c54f93811b2144f9d33c3e&symbols=GBP,EUR,CAD"); // get the dates for use in the string HttpResponseMessage httpResponseMessage = await client.GetAsync(apicall.ToString()); HttpResponseMessage response = httpResponseMessage; if (response.IsSuccessStatusCode) { // put the data returend into a data object I have local. eRateReturn rate = await response.Content.ReadAsAsync<eRateReturn>();
Here is eRateReturn class(s) for data: public class Rates { public float GBP { get; set; } public float CAD { get; set; } public float USD { get; set; } public float EUR { get; set; } }
public class eRateReturn { public float timestamp { get; set; } public string Base { get; set; } public DateTime date { get; set; } public Rates rates {get; set;} }On Thu, Sep 6, 2018 at 8:38 AM Chris Davis chrisd@actongate.co.uk wrote:
Thanks for the reply Russell, I have now discovered this particular thing also supports REST api, just trying to figure out oAuth
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of Stephen Russell Sent: Thursday, 06 September 2018 14:30 To: profoxtech@leafe.com Subject: Re: SOAP
Too bad that Alan is no longer among us, he redid his application all in Web Service calls years ago.
In general, the "service" is a replacement for a data store. You ask for data from the service and it gives it to you in SOAP, xml that is. What you actually receive is some sort of collection of data, that may have collections within it. You could do the same thing in arrays if you wanted in VFP.
Now the data is yours to use at your desire. You may have to package the data back into XML that mimics the data they sent you for inserts, updates, maybe even deletes. Now through the "service" you post that XML pack to them.
Today the industry is changing the name from Web Service to API but in general it works in much the same way.
On Thu, Sep 6, 2018 at 7:31 AM Chris Davis chrisd@actongate.co.uk
wrote:
Is anyone able to share an example of working with a webservice purely in code?
Thanks
Chris.
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]