Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling VFP function from site

Status
Not open for further replies.

aharrisreid

Programmer
Nov 17, 2000
312
GB
My client is running an insurance sales website which invites users to complete a form which is then submitted, a premium calculated, and (hopefully) a sale made via a credit-card transaction. Up to now the premium calculation has been very straightforward (ie. a flat-rate monthly or annual fee), but the formula needs to be modified to take into account weighting factors such as age, health history, postcode, etc.. There is already a VFP function which takes these parameters and produces the required premium via. a complex set of remote views, but it is fast, and it works.

The question is, how can this function be called by the site and return a number of values, which could be in the form of properties of a single object or values in a single row of a cursor (eg. monthly premium, annual premium, underwriter commission, product expiry date, etc.)? I have visions of a self-contained .exe or COM object that can take the parameters and return the results in the form of a comma-delimited string to a file (perhaps as a .csv file, where the first line can have field descriptors) which can then be accessed by the scripting language (or maybe a stored procedure) and the required data extracted. Is this possible? Is there an easier solution? - I bet there is.

I am not familiar with the technology used with the site, but I think the back-end is SQL Server accessed by Perl scripts.

I guess using either an .exe or com object the VFP runtime libraries will have to be present on the server.

As you can probably gather, I am quite a novice regarding this subject at present, so any advice would be appreciated.

Alan
 

I would recommend a Web Service. A web service can be either a COM server or a DLL, registered on the Web Server that can be access from a local machine through the internet.
There are many examples of the constrution and the use of a web service on the Net. FoxPro also a an XML Web service Foundation class

Here is an article on how to build and use a Web Service in VFP. Web Services in Visual FoxPro 8



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
mgagnon,

Thanks for the reply - I'll look into the articles you suggested and take it from there.

Regards,
Alan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top