XML features heavily in this environment and Web Connection provides a host of features for XML conversions as well as server based XML services that allow client apps to simply request data.
Note: The following examples require IE 5.0 or later to view the XML data displays. Other browsers may not display the content or display it as text only.
XML is vital to the Web as a data sharing facility and Web Connection provides you with the tools to integrate this hot technology easily into your existing client and server apps. Web Connection's wwXML class provides easy XML conversions that allow you to quickly move from VFP data and objects to and from XML. The following examples demonstrate data exports, but wwXML also includes XML imports to repopulate/create cursors and objects.
VFP and SQL Cursor XML Conversions:
Customer table presented as
XML (w/ Schema | Show
Code)
This example demonstrates simple data exports to XML using wwXML::CursorToXML().
Note that the output contains a DTD or Schema with structure information that makes
it possible for the client to create data structures on its own. Note the schema
version requires MSXML
2.6 or later.
SQL Server Pubs tables presented as
XML (w/ Schema | Show Code)
This example demonstrates the same functionality for generating XML from an ODBC
datasource using the wwXML::SQLCursorToXML() method. Note: Since VFP returns ODBC
data in cursors you can always use SQL Passthrough or Remote views and CursorToXML()
to convert this data into XML directly without use of this method.
Object XML conversions:
Simple Customer Object presented as
XML (w/ Schema | Show Code)
This example dumps a record to an object using SCATTER NAME and then exports the
object to XML with a DTD or Schema.
Hierarchical Invoice Object presented
as XML (Show
Code |
Invoice Class)
This example creates a complex business object that contains several sub-objects.
An invoice 'container' object with an oCustomer and aLineItems subobjects that host
the customer and line item information. wwXML can render this object structure as
hierarchical XML.
Web Connection provides a number of features for building rich Client/Server applications that do not require a browser front end. Instead you can use a VFP client application to communicate with a Web Connection backend. You can drive Web applications using the HTTP protocol with just a few lines of code. The examples demonstrate simple retrieval of Web content, controlling an application via HTTP, exchanging data between VFP clients and Servers and using a Web Connection server as an HTTP based database server. You can also compile wwHTTPDemo.pjx in the \wwIPStuff_samples directory and run this app from within Visual FoxPro's IDE to avoid using IE.
Run Asynchronous XML Request
This sample request simulates a long running report that's offloaded to another
process for processing, while leaving the Web Connection server(s) free to process
other requests with progress provided via browser polling. Uses the wwAsyncWebRequest
class to submit and retrieve events in a VFP or SQL Server table driven event manager.
View Code