Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running VFP function from site
Message
 
To
01/10/2004 18:33:23
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00948121
Message ID:
00948973
Views:
16
There are a number of ways that you can accomplish this. If the logic already exists on the server you might just modify the logic to return you the data in XML format. If this is done with something like PHP, this won't be automated but rather than creating HTML you'd create HTML.

If you can use a COM object on the server as Claude pointed out you can offload this XML generation to VFP quite easily. From VFP you can CursorToXML() or in VFP 8 the XMLAdpater to quite easily create the XML automatically from cursors. For objects you can use the free wwXML class (http://www.west-wind.com/wwxml.asp) to convert the object to XML. In both cases you'd want to return the XML instead of the HTML result which could then be remotely accessed.

If tis is the only thing you need to do the above will be much easier than going through the process of creating and keeping a Web Service (especially a VFP based one) up to date. Otherwise creating a separate SOAP TOolkit based Web Service as Claude suggest may be an OK idea.


+++ Rick ---







>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
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform