VFP and .NET Interop
Integration Question
Gravatar is a globally recognized avatar based on your email address. Integration Question
  Steve
  All
  May 20, 2017 @ 06:42am

Hi All,

I need to setup a way for external apps to access my VFP Desktop Database. The database my app runs can be either native VFP or SQLServer. The initial app to be integrated is a tool written in .Net that pulls e-commerce transactions, and these transactions need to be inserted into my VFP app.

Would I use the JSON REST service for this? It's like I need an API for and to my VFP app that will allow this .Net app to query and insert data. The requests will not come from a web page, and the responses will not go back to a web page. Is JSON and REST the right approach? Should XML be used?

Thoughts and examples greatly appreciated.

TIA, Steve

Gravatar is a globally recognized avatar based on your email address. re: Integration Question
  Rick Strahl
  Steve
  May 20, 2017 @ 12:09pm

Hi Steve,

Yes from what you say here a REST service is probably the best approach. Building a service will let you both allow the posting interface for the external application to get the data into your server as well as let your client application query the data.

How you actually set up this interface is up to you to choose - you can use either JSON or XML for this - whatever works best for the use case.

In general terms:

JSON
  • more modern interface, expected for modern Services
  • Great with fixed object data
  • Not so great for dynamic data
  • Easy to work with in FoxPro (via wwJsonSerializer and Web Connection for services) and .NET
XML
  • older interface
  • Great with dynamic data
  • Easy to work with in .NET, easy with data (tables), not so good with objects

The bottom line for this is that if you have known structures/objects and an API that deals with objects, then REST and JSON is the way to go. If you're dealing mostly with dynamic queries (where you don't know the result structure up front) then XML and DataSets are easiest. All that said, generally I'd recommend not using XML just because it's more complex for anything but dataset serialization.

Web Connection also includes a wwHttpSql implementation which allows you to remotely run SQL statements using a SQL Passthrough like interface.

  • wwHttpSql
    (drill into the sub-topics to see more detail on how it works)

For internal solutions this might be a good way to go.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Integration Question
  Steve
  Steve
  May 21, 2017 @ 07:15am

Hi Rick,

Thanks for all your great help!

I currently have WWWC v6.10. If I wanted to also possibly setup a few VFP Forms that communicate to my database via JSON, I would also need to purchase the Client Tools, right?

Thanks again and hope all is well in Hawaii.

Steve

Gravatar is a globally recognized avatar based on your email address. re: Integration Question
  Rick Strahl
  Steve
  May 21, 2017 @ 03:04pm

No, the Web Connection license allows for using the Client Tools in other applications. All the Client Tools fetures are built into Web Connection as well, but it all falls under the single developer license (ie. each developer needs a separate license).

+++ Rick ---

© 1996-2017