Hello,
I hope I selected the right forum for my questions.
I need to be able to consume (or call, whichever is the right term) ASP.NET Web API service(s) from a VFP 9 application. The Web API was developed by a 3P.
What I know about their service is as follows:
The API uses OAuth 2.0 protocol for client authentication. OWIN framework is integrated into project for this purpose. For interacting with the API, client app should receive a special access_token from the OWIN framework and pass it in headers in every API request. The following request allows generating a new token: • REQUEST Method: POST Url: /token Body: username=5000&grant_type=password&password=ABC123
Is West Wind Client Tools what I need to incorporate in my VFP 9 app to call this Web API? Is there an example I can look at for this?
TIA Dmitry Litvak

Yes you can use West Wind Client Tools for this. Specifically you might be able to use the wwJsonServiceClient class which lets you wrap REST services with FoxPro methods that call the REST methods.
Calling a service with oAuth tokens involves retrieving a token and then adding the token to the headers you send. What that looks like depends on the oAuth implementation used - there's no generic way to do this. Usually an API provides some sort of endpoint to retrieve the the token and the token is then provided on each request as a header typically (Authorization: Bearer <token here>
).
+++ Rick ---
Thank you for your reply.
Does the old purchase of West Wind Connection (years ago) qualify for the discounted price for West Wind Client Tools ($99)?
https://www.west-wind.com/WestwindClientTools.aspx
Dmitry Litvak
UPDATE: Resolved.
Hi again,
I am learing the The WW Client Tools, based on the shareware copy.
When I use your example 1 in the article http://www.west-wind.com/wconnect/weblog/ShowEntry.blog?id=920
loAlbums = loProxy.CallService("http://albumviewerswf.west-wind.com/api/albums","","GET")
Where you have the code getting the loAlbums, I get error
" Unable to load wwDotNetBridge: " + this.ErrorMsg
This error is in this segement of INIT of wwDotNetBridge class:
*** Fail creation if the object couldn't be created IF ISNULL(this.Load()) ERROR "Unable to load wwDotNetBridge: " + this.cErrorMsg RETURN .F. ENDIF
What am I missing? Thank you.
UPDATE: I found that the problem happens on the line ClrCreateInstanceFrom below:
```text
lcError = SPACE(2048)
lnSize = 0
lnDispHandle = ClrCreateInstanceFrom(FULLPATH("wwDotNetBridge.dll"),;
"Westwind.WebConnection.wwDotNetBridge",@lcError,@lnSize)
The error is '0x80131515', could not load assembly.
And the wwDotNetBridge.dll is in the folder where the code is being executed.
