West Wind Web Connection


Web Connection is a complete Web application framework for developing and delivering scalable e-business solutions with Visual FoxPro. It is a proven development platform for integrating browser, server and database technologies into Web applications for Visual Studio and especially Visual FoxPro developers.

Make sure you read the following important topics:

Don't know where to start? Here are links to get you on your way:

Can't find it, or you're stuck? Try these support links:


What's new

Version 5.20


10/4/2006

Version 5.15


10/4/2006

Version 5.15


10/4/2006

Version 5.10


8/23/2006


Version 5.05


5/24/2006

Version 5.03


4/25/2006

Version 5.01


3/21/2006

Version 5.00


3/2/2006

Licensing

Web Connection is available in two licensing modes: Single server developer, and various sizes of runtime distributions. Developer Licensing for West Wind Web Connection is on a per physical server basis and per developer basis.

For current pricing for both developer and runtime licenses please check our product pricing page.

Single Developer License


The full developer license comes with a single developer license and a live server license so you can develop your application on your local machine and deploy it on a single live server. The developer license provides full source code to the FoxPro framework code and is required for any further runtime or developer licenses to be applied. Any additional developers require either another developer license or a runtime license as outlined below.

Runtime and Additional Developer Licensing


Runtime licensing is available by purchasing a runtime license pack which comes in sizes from 5 to unlimited distributions. A Runtime license can only be purchased in addition to at least one full developer license as the runtime licenses do not come with any distributables - it's just a license pack.

Runtime licenses may also be applied against additional developers on a team with one license per developer required.

A runtime license allows distribution of a compiled Web Connection application and distribution of any of the binary files included with Web Connection. No portions of the Web Connection framework may be re-distributed as source code without a full developer license. Runtime applications can make use of any of the framework classes supplied by the Web Connection framework including the HTML rendering classes and support tools as long as distributed in compiled form (APP/EXE).

Applications built with a distribution license must add significant value and cannot be in competition with the Web Connection development product. The Message Board and Offline Reader applications of Web Connection are excluded from any runtime agreement and may not be re-distributed in volume. A separate license agreement and pricing applies to redistribution of the message board application.

You may modify the source code and visual appearance of the Visual FoxPro Web Connection framework. Regardless of any changes made to the framework itself, it remains copyright of West Wind Technologies. Modification of any non Visual FoxPro binary files is not allowed.

Warranty Disclaimer: No Warranty!


IN NO EVENT SHALL THE AUTHOR, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THIS PROGRAM AND DOCUMENTATION, BE LIABLE FOR ANY COMMERCIAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS, EVEN IF YOU OR OTHER PARTIES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Upgrading from Version 4.0

Upgrades from Version 4.0 should be relatively painless as Web Connection 5.0 for the most part maintains backwards compatibility with Version 4.0. However, in order to take advantage of Web Connection 5.0 features there are a few things that you should do to optimize your applications and allow them to integrate with new tools and the new Web Control Framework.

The topics in this tree describe key changes in the framework that will affect existing applications.

Response.ExpandTemplate Eval Recursion no longer supported

Eval recursion has been turned off by default for Response.ExpandTemplate() and MergeText() and wwEval.MergeText(). This change is by design to minimize potential security breaches.

The main concern is that unchecked nested tags containing user input could easily execute code in your pages in unexpected situations which opens up a huge security hole. For this reason recursion is off by default, and we don't make it real easy to turn it back on.

With recursion on, imagine a user entering this into a textbox:

<%= Version() %>

If your template now echos that value with:

<%= lcInputValue %>

and recursion is on the page will display the FoxPro version number! At this point, effectively the user has executed code in YOUR FoxPro application. Version() is one of the milder problems of what can execute...

So for this reason we've turned off recursive expressions. If you really need recursive expressions, you can use:

<%= MergeText(lcValue) %>

which now explictly recurses the result value.

The wwEval object also contains a lAllowEvalRecursion flag that is off by default. If you have pages that you know explicitly require recursive expressions you can forego ExpandTemplate and instead use this equivalent code:

loEval = CREATE("wwEval") loEval.lAllowEvalRecursion = .T. lcResult = loEval.MergeText( FILE2VAR( Request.GetPhysicalPath() ) ) Response.Write(lcResult)

DEBUGMODE and Error Handling Changes

Web Connection 5.0 introduces a new Error management mechanism that is a bit more flexible and relies on TRY/CATCH exception handling. This new mechanism is more consistent and removes one potential problem issue related to the RETURN TO command in Visual FoxPro and the need to bracket Error methods with #IF define blocks. All of that is gone in favor of a simpler event based error mechanism that can simply be overridden in your code.

DEBUGMODE Flag - Gone


The first change is the removal of the DEBUGMODE flag. This flag was used internally by Web Connection to turn error handling on and off. Primarily it served to bracket error methods in wwServer, wwProcess and your wwProcess subclasses.

The DEBUGMODE flag is replaced primarily by the Server.lDebugMode flag now. This flag is now dynamic and can be changed in your appMain.ini file or even dynamically at runtime on the Server Status form.

Action Item:
You should check all of your code and find any DEBUGMODE usage. Especially check your custom wwProcess subclasses and make sure that there aren't any DEBUGMODE flags. If they wrap Error Methods see the next section on how to change your code.

Custom wwProcess Error Methods


Due to the changes to error handling Error methods should no longer be used in your custom wwProcess classes. If you have Error methods in your Process classes, instead change them to the following signature:

FUNCTION OnError(loException as Exception) * ... your custom error code here ENDFUNC

This method serves exactly the same functionality as the old Error method did, but as you can see it doesn't receive three parameters, but rather a FoxPro Exception object. Errors are caught in a TRY/CATCH as part of the Process class' Process() method and wrapped around the RouteRequest() method. This captures any error in your code and fires the OnError() method on your wwProcess subclass.

Keep in mind that overriding OnError is optional. The most common scenario is overriding how the error message is displayed and you can override that instead by overriding the ErrorMsg() function.

But if you need to explicitly manage your errors here's the default OnError implementation that you can emulate:

FUNCTION OnError(loException as Exception) *** Shut down this request with an error page - SAFE MESSAGE (doesn't rely on any objects) THIS.ErrorMsg("Application Error",; "An application error occurred while processing the current page. We apologize for the inconvenience. " + ; "The error has been logged and forwarded to the site administrator and we are working on fixing this problem as soon as we can.<p>" + ; "<p align='center'><table cellpadding='5' border='0' background='whitesmoke' width='550' " +; "style='font-size:10pt;border-collapse:collapse;border-width:2px;border-style:solid;border-color:navy'>" + CRLF +; "<tr><td colspan='2' class='gridheader' align='left' style='font-weight:bold;color:cornsilk;background:navy'>Error Information:</th></tr>" + CRLF +; "<tr><td align='right' width='150'>Error Message:</td><td>"+ loException.Message + "</td></tr>" + CRLF +; "<tr><td align='right'>Error Number:</td><td> " + TRANSFORM(loException.ErrorNo) + "</td></tr>" + CRLF +; "<tr><td align='right'>Running Method:</td><td> " + loException.Procedure + "</td></tr>"+CRLF+; "<tr><td align='right'>Current Code:</td><td> "+ loException.LineContents + "</td></tr>"+CRLF+; "<tr><td align='right'>Current Code Line:</td><td> " + TRANSFORM( loException.LineNo) + "</td></tr>"+ crlf +; "<tr><td align='right'>Exception Handled by:</td><td>" + THIS.CLASS + ".OnError()</td></tr></table></p>") *** Log the Request IF TYPE("THIS.oServer")="O" AND !ISNULL(THIS.oServer) this.LogError(loException) ENDIF *** We've completely handled the error! RETURN .T. ENDFUNC

Change Process Class Process() methods to OnProcessInit()

The wwProcess class has been reworked to be a bit more modular to provide for easier isolation of processing and improved error handling. In order to make this happen the Process() method has been relegated as a high level dispatch method only which delegates to lower level methods.

The typical flow of a request now is:


  1. wwProcess::Process() called
  2. wwProcess::OnProcessInit() called
  3. wwProcess::RouteRequest() called
  4. wwProcess::OnProcessComplete() called
  5. if an error occurs OnError is called (default implementation exists)

In Web Connection 4.0 you previously used the Process() to hook up any operation that applied to all requests that hit this process class - it fires on every request.

This behavior still exists, but the recommended hook point now is OnProcessInit().

Action Item: Rename Process() to OnProcessInit
In most cases you can simply rename your Process() method if you even have one to OnProcessInit() and you should be good to go. The only rare exception is if you need to create PRIVATE variables visible further down the call stack. For more info see the OnProcessInit() topic.

Action Item: Add PRIVATE defines at the top of the Process PRG file
If you use the new Wizards, Web Connection automatically generates a set of PRIVATE vars for the 'known' server objects like Request, Response, Server etc. at the top of the PRG file so that they are always visible. This makes it possible to make assignments to these classes at any time without worrying where you are in the FoxPro call stack.

LPARAMETER loServer LOCAL loProcess PRIVATE Request, Response, Server, Session, Process STORE .null. TO Request, Response, Server, Session, Process

Using the new wwPageResponse Class

This topic is an optional one and deals with converting to the new wwPageResponse class as opposed to the Version 4.0 wwResponse class. This class is more lightweight and provides the ability to build up your page content more consistently by allowing header creation at any time, so you can add Cookies and other header items at any time. It basically replaces the wwResponse and wwHTTPHeader class combination of classes.

Tip: Can't use the wwPageResponse class? Try wwPageResponse40
The wwPageResponse class removes many 'utility' methods of the wwResponse class. If you have legacy response method calls that don't work with the wwPageResponse class, there's another subclass of the class called wwPageResponse40 that adds back the various dropped methods like all of the Form???() methods, Send/SendLn and a few other methods that had been dropped.

Web Connection 5.0 works with the old Response classes by default, so you don't have to change anything to get your code to run. However if you want to use the new object you will have to make a few adjustments to your existing code.

Action Item: Enable the wwPageResponse class
In order to use the new wwPageResponse class you have to set a property in your wwProcess subclass definition.

************************************************************* DEFINE CLASS wwStore AS WWC_PROCESS ************************************************************* cResponseClass = [WWC_PAGERESPONSE] *** If you need to use the 4.0 compatibility class * cResponseClass = "wwPageResponse40" ... ENDDEFINE

The wwPageResponse class mixes wwHttpHeader and wwResponse functionality so anything that used to require separate headers can now in most cases use the wwResponse object directly. For example:

Response.AddCookie("TestCookie","MyValue","/wwstore") Response.Headers.Add("Expiration","-1") Response.AddForceReload()

The old way still works as well so you can still construct a wwHttpHeader object and pass it to ContentTypeHeader(), but this is not recommended because that mechanism will output the header immediately.

Action Item: Remove wwHttpHeader code and replace with Response methods
To optimize your code remove any wwHttpHeader related code and use the Response methods directly.

Make sure you test your code. If you should run into problems with headers they will most likely be related to duplicate headers. In those cases make sure that you are not explicitly writing out headers in your application code. Always try to use the wwPageResponse object directly.

Log and Session File Structure Updates

The format of the wwRequestLog and wwSession files have changed so if you're upgrading make sure that you delete both wwRequestLog.dbf and wwSession.dbf before running your application. If you're running the Setup application it will prompt to delete the DBF files for you.

If you're using SQL Server log and session data you will need delete the Log and Session tables and then run the Console SQL Wizard to recreate them or manually update the tables.

wwRequestLog Changes
The wwRequestLog has been updated to hold a unique Request Id that is passed from the ISAPI extension.

CREATE TABLE (THIS.cLogFile) FREE ; ( ; TIME T ,; REQID C(20),; Script c(50) ,; QueryStr M ,; REMOTEADDR C(16) ,; Duration N (5,2),; MemUsed C (8) ,; ERROR L ,; REQDATA M,; Browser M,; Respone M )

For SQL Server:

CREATE TABLE [dbo].[wwrequestlog] ( [time] [datetime] NOT NULL , [reqid] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [script] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [querystr] [varchar] (254) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [duration] [numeric](7, 3) NOT NULL , [memused] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [error] [bit] NOT NULL , [reqdata] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [browser] [varchar] (156) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]


wwSession Updates
The wwSession class has changed the way the Session table is created by widening the SessionID to 14 characters. The widening is to ensure unique session ids that create SYS(2015) plus the current ThreadID.

If you use FoxPro Table Session (wwSession) then you can simply delete your wwSession table. Web Connection will automatically recreate the file as needed. The update structure is:

CREATE TABLE ( THIS.cDataPath+THIS.cTableName ) FREE; (SESSIONID C (14),; USERID C (15),; FIRSTON T ,; LASTON T ,; VARS M ,; BROWSER M ,; IP M ,; HITS I )

If you forget to update your FoxPro table the code will still work but the new ThreadID is stripped. This is not really an issue - you get essentially the old behavior. This change really only affects high volume applications where many instances are running simultaneously.

For SQL Server you will need to modify the database and change the

CREATE TABLE [dbo].[wwsession] ( [SessionID] [char] (14) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [UserId] [char] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [firston] [datetime] NOT NULL , [laston] [datetime] NOT NULL , [vars] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [browser] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [ip] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [hits] [int] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO

If you forget to update the SQL Session table you will get errors when trying to write a new session record.

Acknowledgements

West Wind Technologies would like the following people for their invaluable help with this product and otherwise lending valuable support.

West Wind Most Valuable Professionals
We're acknowledging the support many of the people in our community have given back to others on the message board and around shows and other events. We here at West Wind Technologies and the community at large thanks these individuals by awarding MVP awards. To find out more visit the MVP site.

Randy Pearson
Randy Pearson of Cycla Corporation has been an extremely active member in the Web Connection user community to the point that many people visiting the message board think he's a West Wind Employee, which he is not. His valuable contributions and thoughtful comments and suggestions can also be found in many aspects of Web Connection and had an impact on many of the features found in the product. Finally, Randy was in charge of the Migration topics found in this help file along with with the Migration Tool utility to move 2.x projects to 3.x. Randy is also co-author of the WebRad Web Connection book.

Lauren Clarke
Lauren has become one of the top resources on the West Wind Message Board and has been a huge help in testing various new developments in Web Connection. He's also been instrumental in a number of ideas and tossing around brainstorming ideas for new features in the product.

Markus Egger
Markus (EPS Software) and I have been business and development partners for some years now and Markus although not directly involved in this product has always been a great help in bouncing ideas and concepts off of. Many of these have found their way into Web Connection.

James Murez
For all of his help related to pushing Web Connection harder as a product and improving visibility both for WWWC as well as Visual FoxPro in general. He's also been very actively testing several not so often used components of Web Connection and provides tons of feedback both on the documentation as well as on bugs/inconsistencies.

Erik Moore
Erik has worked on some technologies that have been silently integrated into Web Connection and he's had valuable feedback and discussions on several topics ranging from XML, SQL and ADO to the WinInet functionality in wwIPStuff.

Ken Levy
Ken's been big help in providing info on XML and a link to Microsoft for bugs and odd behaviors. Even though he cut his hair and doesn't work in the Fox team anymore, he's still one of us. Ken's been invaluable in helping isolate a number of bugs in the DHTML and XML object models that have been fixed since.

Microsoft Visual FoxPro Team
For the obvious: Providing us with a tool that is so powerful and lets us do things so easily that it simply boggles the mind that you can't do many things in other more visible Web products. I want to specifically thank Calvin Hsia for his help on many COM related issues on the road to providing the scalability in Web Connection. Also, Randy Brown for his support and help with various WinDNA related issues in VFP.

The frequent Message Board Crew
Yeah, that's all of you who frequent the message board and help out others or ask pointed questions about features and (gasp) bugs. Without this feedback this product would not evolve as much as it does.

I thank all of you for your help and support of making this product such a success in the FoxPro market!

+++ Rick ---

Rick Strahl
West Wind Technologies

Shareware version limitations and issues

The shareware version contains the Web Connection libraries in a pre-compiled format and as such imposes a few limitations and special behaviors.

Alias name already in use Errors when running demos


This error can occur if you've loaded the Web Connection libraries and then run some of the demos that use code contained in CONSOLE.EXE. Both WCONNECT.APP (the Web Connection pre-compiled library) and CONSOLE.EXE contain the Web Connection classes and if a class library is already loaded it can cause the above error to occur.

This is not an issue with the full version as source code is available and VFP can properly
load the classes from the source code when run.

If you see this error there are two ways to deal with it:

It's good practice to assign the following to a Macro key in VFP:

CANCEL CLEAR ALL CLOSE ALL RELEASE ALL CLEAR PROGRAM CLEAR SET CLASSLIB TO SET PROCEDURE TO

and excercise this key frequently to clear the environment.

The shareware version cannot build a VFP Project


Because the shareware version is precompiled and you can't add .APP files to a project directly, the shareware version of Web Connection does not build a VFP project file when building a new Web Connection application.

However, you can stil run any Web Connection application simply by executing the main PRG file (ie. DO webDemoMain.prg).

The shareware version runs in debug mode


Because the shareware version is precompiled a number of Web Connection's compiler directives are precompiled into the application. One of these settings - DEBUGMODE - specifies how errors are handled in Web Connection. The shareware version runs with DEBUGMODE = .T. which stops on errors, so all errors actually stop the Web Connection server and pop up in the Debugger.

In the full version you can swap the flag to .F. which makes Web Connection handle errors and display an error page and send notification emails etc. but in the shareware version the behavior is fixed to break at the error.

The shareware version pops up a shareware form every half an hour


In shareware mode Web Connection pops up a form every half an hour to notify you that this is the shareware version. This screen also stop operation of the server until you accept the form.

Recommended system downloads

The following components are useful when running Web Connection:

Office Web Components for graphing
The Office Web Components are used on some of the graph demos and internally to generate graphics for the logs and a few other places. These components require an Office license (2000 or XP). It's recommended you download the latest version from the link below even if you have Office XP as the ClassIds for these components have changed.

http://office.microsoft.com/downloads/2002/owc10.aspx?HelpLCID=%HelpLang%1033

System, software and hosting requirements

Web Connection is designed as a server based application and thus requires a Microsoft Windows based server environment for deployment. It can however run just fine on Windows XP and Windows 2000 Desktop.

Server Software


For development you can use client Operating systems like Windows Vista, Windows XP or Windows 2000. Windows 98 or later will also work, but we discourage use of that operating system for Web Development. For deployment a Server like Windows 2000 Server/Windows Server 2003 operating system is required due to Microsoft's licensing policies.

Web Connection works with any true ISAPI compatible Web server. The product is designed primarily on Microsoft Internet Information Server (IIS), which provides best performance, stability and the full range of features. It also works well with Apache given a few limitations. It also works with O'Reillys WebSite and any other ISAPI compatible server. We do recommend IIS especially IIS 6 as it provides the most stable and compatible platform for Web Connection.

Development Software


Web Connection 5.0 is designed for Visual FoxPro 9.0, but supports version 8.0. We highly recommend using Visual FoxPro 9.0 or later for best performance and taking advantage of all the latest features of the product.

If you plan on working with the Web Control Framework you'll want to use Visual Studio 2005 or the free Visual Web Developer 2005. Web Control Framework pages are plain text, but in order to get the full design experience a ASP.NET 2.0 compatible environment should be used. Click here for more info on whether you need Visual Studio.

Otherwise plain HTML editing tools like FrontPage and Dreamweaver can also be used for editing standard templates or even Web Control Framework templates (although you won't get full designer support for the controls). Of course you can edit any HTML templates including script and Web Control Framework templates with any text editor like Notepad or even the Visual FoxPro text editor.

Hardware


Web Connection can run on just about any hardware. The software ran 10+ years ago on Pentium II machines and it can do so still today. Basically you'll want a machine that can run Visual FoxPro comfortably. More than anything memory is important - Web Connection instances take between 10-15 megs of memory each typically (although they can take more depending of what you do in your server code). Recommended minimum memory for an IIS server running Web Connection is 256 megs. It'll run in less, but it's not optimal.

For development we recommend the max amount of memory you can afford as it will make your dev environment work more smoothly. With memory under $200 a gigabyte, it's easy to justify running with a 1 gigabyte of memory or more. Web development is very memory intensive especially if you use Visual Studio or Visual Web Developer. Also a fast machine won't hurt for development as you spend a lot of time flipping back and forth between different applications (VFP, Web Browser, HTML Development Tool etc.).

Web Hosting


Web Connection must run on a Web Server and getting the application online means that you are connected to the Internet. There are a variety of ways available to do this from in-house hosting to co-location (your server at an ISP's facility) or plain Web hosting.

The latter option tends to be the cheapest but unfortunately it's not likely that you will be able to use it for your Web Connection applications as a WWWC application requires binary executables which are usually not allowed by low end Web hosting services. However, there are special providers that specialize in hosting binary based application services and you may be able to talk to your ISP to get them to host you in this fashion.

Co-location lets you have your own machine or one provided by the ISP at their facility. The big advantage here is that you have full control over the server and can configure it as you choose. This usually includes the ability to add custom user accounts, set the security permissions for the server, add remote access services for pcAnyWhere or the like. It also makes sure that your application is the only one running on the server so that there's no interference or problems from these potentially dangerous applications running on the server at the same time. Co-location tends to be more pricey but for the piece of mind and control can save you lots of headaches. Pricing varies, but typically runs $200 a month and up.

Finally your company may already have an internal Internet connection and you can hook your server application into that network. In this situation you probably have to deal with your network administrator and any of the security policies configured for the company network. If your application is completely internal to your company (an Intranet) then a public Internet connection is not required. If your application is used both internally and externally (an Extranet) you will still need with the security issues of an open Internet connection through your IT staff.

For a list of providers that are Web Connection and Visual FoxPro friendly and provide related services, see http://www.west-wind.com/webconnection/webhosting.asp.

Documentation in Word Format

This document is also available in Word format at:

Documentation in Word Format

You can use Word to print the document into hard-copy. If you don't own Word 97 or Word 2000 or Word XP you can download the Word viewer from:

Word Viewer 2003

Note: The Word documentation may not be the very latest version as we only periodically update the Word docs. The Word file is also very large and you'll likely want to print only selected sections.

Web Connection WebLog



http://www.west-wind.com/wconnect/weblog/

Support and reporting bugs



Support is available for free on our online West Wind Message Board. This site also links to a knowledgebase and makes a great first stop for any questions you might have. In addition to our staff, there's a great community of Web Connection developers and support questions are generally answered within a few hours - often less. To visit the Message Board go to:

http://www.west-wind.com/wwthreads/

Before you post:
Please, double check your code before posting to make sure you didn't overlook something obvious. When you post make sure you provide as much information as possible. Most importantly provide any error information that might be available for the Web Connection classes and Visual FoxPro. Most Web Connection classes have an lError flag and a cErrorMsg property which you can check for failure information. All of this will ensure we can answer your question more efficiently and get you up and running as quickly as possible

Additional Support:
If you require additional personalized support, you can contact West Wind Technologies for paid support via Email or Phone. We also provide customized on-site training and mentoring services. You can contact us for any of these services at:

West Wind Technologies
32 Kaiea Place
Paia, HI 96779
USA

Email: support@west-wind.com
Phone: (503) 914-6335
Fax: (815)572-0619

Please be aware that support is charged at regular consulting rates of $150/hr in half hour increments.

Message Reader


We also provide the very useful West West Wind Message Reader that allows you to download and read/write messages in a rich client environment. The offline reader also consolidates many of the message board tasks such as Chat, Knowledgebase Searches, Bug Reporting into a single organized interface.

The message board provides the following features:


These resources are very rich and provide you with both researchable material and the ability to ask questions about any problems you might have. The message board is monitored throughout the day and most questions are answered within an hour. Our official support response time is 24 hours weekdays, but most questions are answered within an hour during the day.

The West Wind Message Reader


In addition to the online Web application we encourage you to also use the Offline Message Reader which gives you access to all of these features via a local application. The reader makes it easier to write messages, format them and search and organize messages as well as providing a local searchable database of the message board content.

To run the Message Reader click on the West Wind Message Reader option from the Web Connection menu pad in Visual FoxPro or click on the shortcut in your Task Bar's Web Connection group.

The offline reader allows you to compose and read messages in the rich environment of a GUI application and provides support for creation of rich messages using standard editing features. As the name implies you can read and create messages offline and post them, get more messages when you reconnect. This is ideal for people while travelling or for those that have slow dial up connections. This environment is also much nicer to use than the Web application, so give it a shot.

The West Wind Knowledgebase


Go to the message board and hit the Knowledgebase Link to find our article databases, product information and knowledgebases for information about issues and solutions encountered before.

Reporting Bugs


If you have issues with the product that are outright bugs that cause failures and don't work as described you can use the bug reporting tool which is accessible either from the Message Reader or via the Web Connection menu in Visual FoxPro.

The bug report form asks you create a detailed error report to provide a reproducable scenario.

Please use this form only for problems that are reproducible or are outright bugs. If you're not sure how a feature or command works post a message on the message board. This mechanism is meant to be used as a basic bug tracking mechanism on the message board to allow tracing bugs from submission through resolution via message threads.

Pricing, Purchasing, Reselling and Warranty



http://www.west-wind.com/pricing.asp

Latest News at West Wind Technologies



http://www.west-wind.com/westwindnews.wst

Web Connection Developer Registry



As a Web Connection developer you can sign up for the free Developer Registry that allows you to advertise your Web Connection related services in our registry. Fellow developers or prospective clients can search the registry and find your entry in their geographical area. The registry has been fairly popular and many developers and prospective clients have reported finding good matches for both developers and clients to get projects developed.

http://www.west-wind.com/wwDevRegistry/

User Guide

The user guide outlines the basic operation of Web Connection.

What is Web Connection

Web Connection is a complete Web application framework for developing and delivering scalable e-business solutions with Visual FoxPro. It is a proven development platform with a 10 year history that has proven itself stable for a wide variety of Web and distributed applications from small to large scale. With Web Connection you can get your FoxPro applications online be it for HTML Based Web applications, or XML based distributed applications. It provides both the client and server tools to build powerful applications in either environment.

Web Connection provides a powerful modular framework that interfaces FoxPro with the Web Server. The core engine provides all the interfacing and server infrastructure with various modules and handlers plugging into the architecture. You can choose from building applications that use pure code to generate output, to using high level modules like the powerful Web Control Framework that provides a rich object oriented control and event based model to build applications more efficiently using a more familiar and productive desktop metaphor.

Web Connection provides you with lots of choices for generating output from your application. At the lowest level you can do everything in code - respond to requests, picking up request data with pure code and running your own FoxPro code to generate HTML output. Other mechanisms provide more highlevel generation tools. The base script support allows you to use external templates with a textmerge like mechanism to externalize HTML generation. You can generate output from FoxPro reports to PDF files and use many high level functions to generate HTML from data quickly.

Finally there's the powerful Web Control Framework which manages many aspects of Web Page display. It automatically manages page state, and re-assigns control content on postbacks, allows persisting data across requests and can generate HTML from easy to use controls that you can programmatically access in your code. You simply set the text property of a textbox, vs. generating HTML for the entire textbox for example, and communicate with the textbox's properties to set things like color alignment, fonts etc. The Web Framework in conjunction with Visual Studio or the free Visual Web Developer allows you use a visual drag and drop design surface and easy to use property editors to visually design your layouts and set up control layouts. This is the recommended mechanism for building Form Centric HTML Web applications with Web Connection 5.0.

What is Web Connection?


Web Connection consists of two major pieces of software that make up the overall product. A small C++ based connector application (ISAPI dll) that implements the communication interface between the Web Server and your Visual FoxPro application, and an extensive framework of Visual FoxPro classes that makes it easy to build application specific Web code. The Visual FoxPro framework is object oriented, extensible and open and is shipped with full source code when you purchase the product. You can see how it works and if necessary extend or modify the base code. No black box code here!

The Visual FoxPro framework consists of classes that manage communication with the Web connector ISAPI extension. They handle server management and administration, retrieving server and browser form variables from the server making them easily available to your code and providing a powerful set HTML classes and support tools that make short work of interactively building the HTML required to display your application on the Web. Web Connection provides access to all advanced HTTP based features including displaying HTML script pages containing FoxPro code and expressions from disk. Many advanced features like HTTP Authentication, HTTP Cookies, Sessions, custom HTTP headers, request logging, remote administration and configuration and server load balancing are built into the product and easily accessed through the framework.

And you can use rich design tools with Web Connection, so you can use FrontPage or Dreamweaver and the like to design your page templates, or if you're using the Web Control Framework using Visual Studio or Visual Web Developer to design your pages graphically in an interactive WYSIWYG environment.

Built for FoxPro and the way YOU like to work


Web Connection is built to work with Visual FoxPro from the ground up. The framework itself is written in FoxPro and anything you can do with FoxPro can be used in your Web applications. You can use it to access database tables, run queries against FoxPro or SQL Server or Oracle databases, you can use business objects or you can access the data directly. How you write your application is really up to you - Web Connection provides only the plumbing - you provide the application logic.

You can use existing business object frameworks with Web Connection. There are countless applications out there that use Mere Mortals, FoxExpress, Visual MaxFrame and others with Web Connection. And Web Connection itself also includes its own light weight business object framework that you can optionally use. While a Business Object Framework of some sort is recommended you don't have to use it of course - you can use FoxPro code and data access directly just as well.

Distributed Application Support

Web Connection can also built Fat Client applications let you use Visual FoxPro desktop applications communicating with a Web Connection (or other) Web Server application. Web Connection includes a rich set of client tools that can provide connectivity over HTTP using plain XML or the SOAP protocol for Web Services.

With Web Connection you can run SQL queries over the Web and create and call Web Services. You can create custom XML services or use more standard Web Services. Web Connection provides the client side HTTP tools as well as high level XML conversion tools that make XML integration a snap. The Web isn't all about HTML and these data messaging features let you build powerful distributed applications that aren't limited by HTML output. Several examples that demonstrate rich client applications are also provided in the box.

Chock full of tools, utilities and utlility functions


In addition Web Connection also provides tools for sending and receiving email (SMTP/POP3), sending and receiving files via FTP, low level TCP/IP access. There is an included light weight business object wwBusiness class that provides an easy way to get into building more structured applications. A wwSQL component helps interfacing with Database servers like SQL Server and Oracle and there are literally hundreds of utility classes that can be used in your application be they Web or desktop based.

Documentation


There's ample documentation of all aspects of the Web Connection framework, covering both the inner workings of the framework as well as detailed reference materials and a number of detailed tutorials for the different processing mechanisms. Web Connection comes with over 100 small samples that you can check out and look under the hood of to learn and plug into your own code. And there are a number of full scale sample applications that demonstrate many of the framework features in a more complete environment.

Some examples include a WebLog example, the Message Board application and a PhotoAlbum application to name a few.

Web Connection has been field tested on a number of high volume sites and even back in 1996 there were sites running in excess of 2 million hits a day. Imagine what you can do on today's hardware.

So read on and get ready to get Webbified! It's never been easier to build Visual FoxPro Web Applications!

…and what it isn't


Web Connection makes it easy to build Web applications, but it will not take an existing application and run it on the Web as is. Work is required to convert the interface to an HTML based design and if your application mixes interface and database logic tightly, existing code might not be easily integrated into your new Web application. On the other hand if your business logic is separated clearly from the interface then reusing business rules and other rule based classes or procedures will be easily integrated into your Web applications. Keep in mind you will have access to almost all of Visual FoxPro's wonderfully powerful features with the exception of VFP's GUI features!

Web applications are server based and respond to requests made from a Web page. Every action that occurs on a Web page generally fires back to the Web Server. In that sense Web applications are not truly event driven but follow a more rigid transaction based Request and Response model. Web Applications also are stateless and that imposes additional considerations. The short of it is that Web applications by nature are VERY different from Desktop applications.

The new Web Control Framework provides a programming model that is conceptually similar to Desktop Form development and is the recommended approach for first time developers as it provides a familiar control and event based metaphor for building Web applications. But even though the model is similar, understand that you are still bound by the limitations of HTML/HTTP based interfaces, so don't expect to be able to EXACTLY duplicate desktop application interfaces via HTML. This is neither always possible nor desirable as HTML interfaces often have different design targets.

The core feature that Web Connection provides is the ability to continue to use FoxPro code to build your Web applications. You can write code in the tool you are familiar with and you can likely reuse any non-User interface code in your Web application.

Another option for existing standalone applications is to build a distributed application that use the Web as a data transfer mechanism. If you go this route your UI code can potentially be reused using data pulled down from the server using tools in the wwIPStuff library. See the Online Distributed Application Demo for an idea of what you can do.

If you're new to the Web take a deep breath and read on - there's lots of info in this document that will clarify the way the Web works. Web Connection makes it easy to leverage your FoxPro skills. Once you understand the basic flow of information over the Web things will fall into place and allow you to be productive very quickly. You can crank out quality high performance applications without having to learn all of the Web technology up front and you'll learn about Web technology as you use Web Connection to build applications.

Roadmap to starting out with Web Connection

Looking at this documentation you may be feeling overwhelmed with information overload. Relax! You don't need to understand nor even read everything that's in this documentation, but when you want to dig deeper and understand some of the topics the information is there waiting for you. This topic serves as a roadmap for your startup with Web Connection.

This topic is designed to summarize the things that you should most definitely look at. It gives you an idea on where to start, what to try to get going and where to look for more information.

Use the Help File! It's got tons of information, and if you get stuck the answer is likely in here. It's keyworded and searchable in addition to the Content view, so take advantage of this very rich resource.

Setup and Installation


The first step in getting Web Connection installed is to install the product from the self-executing ZIP file. Run the file and the following installtion program. You can find more info on installation at this topic:

Setting up Web Connection

Checking out the demos


This step serves two purposes: It makes sure that the installation works and lets you see Web Connection in action with demos that you can look at and code you can step through if you choose. Make sure you run the Web Connection server (DO wcDemoMain.prg).

Go to the demo page

Most of the examples on the demo pages have links to show you the source code required to create that request by clicking on the [Show Code] link on the bottom of the page. At this time you can also start poking around in the code, making a few adjustments, maybe creating a new method and stepping through the code to get an idea what's involved in writing code for Web functionality.

There are two sets of samples: Core samples and Web Connection 5.0 samples, which sit on a separate page. To get started it may help to look at a few of the core samples first and see how Web Connection works in 'raw' code mode. Once you get the basic idea of how the Request and Response objects and the wwProcess class work, then you can take a look at the Web Control Framework samples, which are a little more complex and utilize a lot of the base functionality.

Take the Step By Step Guide


The next step is to take the Core Step by Step Guide or The Web Control Framework Step by Step Guide which takes you through the motions of creating a new project, setting up custom requests of your own and writing code to handle a variety of tasks. This is a nice intro that shows you how to get started quickly with your own code. I suggest you follow the examples exactly creating the test project shown there to take you once through the process before building your own project in the next step. The Web Control Framework work through is also available as a Video walkthrough.

Digging a little deeper with the Framework Walkthrough


If now you're curious about some of the more advanced features of Web Connection and how things work behind the covers you can check out the How Web Connection workstopic. Here you find information on the architecture, how requests flow through the framework and another walk through that describes more advanced features that weren't covered in the Step by Step Guide.

This step is optional, but if you want to get the most out of Web Connection this topic tree will be well worth the time to read easpecially as you get more experienced with Web Connection.

Use the Web Connection Management Console to create a new project


Once you have familiarized a little bit with how Web Connection works you're probably ready to create your own requests for your own application. To do this you can use the New Project Wizard by running the Web Connection Management Console. To start the management Console type DO Console.exe into the command window or run the EXE from Explorer.

The new project will set up a new VFP application for you that you can start to write your own requests with. Now it's time to write access your business logic from within these Web requests and create some output to display back in the browser. As you start writing code you likely run into a few situations where you don't know how to do something. I suggest you go back to the demos and see if you can find something there that demonstrates what you're trying to do. Again, the message board is a great resource to post questions to if you get stuck or even if you want to bounce some ideas of other developers who have been down the path.

Use the Help File, Luke


Once you start your own development you will want to keep this help file handy. The extensive class reference will come in very handy as you start creating requests using the Web Connection framework classes. Most of your development work involves a couple of objects - wwRequest, wwResponse and wwProcess - take a look at those in detail to get up to speed quickly on what's available to you. Also, by now you may want some additional information on how things work and not just work by example from the demos.

The User Guide provides you with general discussion while the Class Reference (Framework Classes, Framework Support Classes, Utility Classes) provides detailed information on the actual classes in the framework. The class reference is laid out to provide an overview in the class header topic with examples and things to look out for with the actual class detail following class reference format showing the actual mechanics.

Configuration and Installation


Once you've built an application you will need to actually install it on a Web server or other server machine. Although this process is not difficult there are a fair number of files and components involved. The Web Connection Configuration topic describes many of the configuration components and the options available in them.

You can also resort to the Management Console and the Server Configuration Wizard to help you with configuring your Web server with the appropriate virtual directories and script maps as well as copying and registering the Web Connection components for your application.


Setting Up Web Connection

The first step in getting going with Web Connection is to install the product. Web Connection ships as a self-extracting zip file that you either download from the Web or comes on a CD.

Unzip the Web Connection Install files


Click on the EXE file and unzip the application into a directory of your choice. The file is a WinZip self-extracting file, so it should ask you to either open the file or extract the content to a directory of your choice. I suggest you extract to a directory. This first step creates the Web Connection application directories, which are where all of the source and support files get installed.

Web Connection installs a hierarchy of directories as follows:

wconnect
	classes*	-	VFP source and direct support files for the framework (required for development)
	html		-	HTML sample pages
	scripts*	-	The Web Connection ISAPI DLL and CGI executable file
	templates	-	The Management Console File templates
	tools		-	several useful support tools and classes
	wwdemo		-	VFP source for the demos that ship with WWWC
	wwThreads	-	VFP Source for the Message Board
	wwReader	-	VFP Source for the Message Board Offline Reader application
	WebControl	-	The Web Control Framework Samples
	WebLog		-	The WebLog sample application

Run the Setup Program


The next vital step is to run the
Setup program which is installed into the Application root directory. The Setup.exe file should launch automatically when the unzipping completes - however if it does not make sure to run this file manually before proceeding. To do so, start Explorer, go to the Web Connection install directory and double click on Setup.Exe. The Setup program topic takes you through the installation steps - please read these topics as you step through the installation.

In case of problems


If something goes wrong during installation and your server won't work you can look at the Setup Troubleshooting topic, which describes a number of problem scenarios and attempts to take you through them. If these don't work for you you should post a message on the message board at http://www.west-wind.com/wwThreads/.

Checking out the demos


This step serves two purposes: It makes sure that the installation works and lets you see Web Connection in action with demos that you can look at and code you can step through if you choose. Make sure you run the Web Connection server (DO wcDemoMain.prg). You Should be able to navigate to http://localhost/wconnect/ to get started.

Most of the examples on the demo pages have links to show you the source code required to create that request by clicking on the [Show Code] link on the bottom of the page. At this time you can also start poking around in the code, making a few adjustments, maybe creating a new method and stepping through the code to get an idea what's involved in writing code for Web functionality.

Unzipping the self extracting Zip file

If you're reading this topic in the help file it means that you're past this step, but for completeness here is additional information on the installation process.

Web Connection is installed from a self-extracting EXE file that allows you to unzip the program files into a directory of your choice. The files extracted are the actual installation files so put these files into a permanent directory, not your temp directory.

Once unzipping is complete the program will automatically launch into the Web Connection Setup program. If this didn't occur automatically you can start the SETUP.EXE program from the Web Connection installation path. This program is required to configure Web Connection for your current Web server installation. Press F1 at any time for detailed instructions on the available options during the install process.

Understanding Directory Structures


Installation starts from the ZIP/EXE file you download. When that unzip program finishes you get a dialog that states that you should unzip the files into an application directory as you would with a full application installation. It gives you a default like c:\wconnect, which you can change, but should probably make it clear that the files shouldn't go into a temporary directory.

The files unzipped are the Web Connection framework files and your starting point for the installation. Web Connection requires two sets of directories:

These two paths should be completely separate - the Web path underneath the Web root and the application path whereever you choose to install it. Under no circumstances should these point to the same locations.

Other than first installation you don't need to know how this works. Use the defaults and all of this will be set up for you. If you change the defaults and you don't know what these values mean you can run into trouble, but then the issues are described for the help topics for the Setup Wizard.


The Setup program

Go to Step 1



The setup program guides you through the first time configuration of Web Connection for your Web server. The setup process performs the following tasks automatically. For reference I also mention how you can configure these things manually.

These settings are the basic settings that must be performed for a Web Connection installation. The Setup program as well as the Web Connection Management Console New Project Wizard perform these task for you automatically, but it's important to understand what happens behind the scenes in case these settings do not work or are accidentally changed. If you or your administrator needs to know what happens with Microsoft Web servers or you want to manually configure settings check out the topic manually configuring Microsoft Web Server.

Step 1 - Picking the Web server

Next Step


The first step in configuring Web Connection is to pick the Web server to run on. This choice is very important as it will determine how to configure the server as well copying the appropriate files.

The server selections are straight forward. Web Connection should work fully with an ISAPI compatible Web Server and using file based operation with CGI based Web servers. It's highly recommended you use ISAPI for much improved performance. All Microsoft servers as well as Apache and Website are automatically configured - all other Web servers require manual configuration as outlined in the Setup Program step.


West Wind Web Connection works best Microsoft Internet Information Server 5 or later as well as Peer Web Server (also called Personal Web Server) on Windows NT Workstation. Other platforms and tools also work well, but the development of this product is focused on Internet Information Server and there may be features that don't fully work on other platforms. It's also highly recommended that you use Windows NT rather than Windows 98 to develop your application, both for stability of the dev environment as well as consistency between development and deployment environments.

If you're using IIS you can also select a Web site to install the Web Connection installation on. By default Web Connection uses the default Web site which should serve most situations. Advanced users or ISP's that have multiple sites can use the Advanced IIS Site Selection link to select a Web Site and domain to configure the site on:

The drop down will list all sites installed on the selected domain name or IP address.

Step 2 - Configuring the temp path

Next Step


When Web Connection runs in file based messaging mode it uses temporary files to pass messages between the Web server and the Visual FoxPro application server. These messages are picked up by the VFP server polling for the files in the temporary directory and it's important that both the ISAPI extension and the VFP server agree on this path. This option writes Path and TempFilePath values to wc.ini and wcDemo.ini (which is the demo application) respectively.

IMPORTANT

This directory must have FULL access for the SYSTEM and IUSR_ (on IIS) annonymous Web Server User Account. When a request comes in in file based messaging the Web server/wc.dll needs to create and write and read the temporary message files. This request runs under standard Web server security so this will typically be the IUSR_ account.

Step 3 - Configuring the virtual path

Next Step



This step configures a virtual directory where Web Connection installs its ISAPI extension and sample files. This serves as the home base directory for Web Connection. It's highly recommended that you stick with the default values.

Script File Path
You're asked to provide a physical disk location which can be anywhere. This should be a path that's part of the Web directory structure (ie. this is an HTML path not a Code path). The default will be the server's Web root plus wconnect and this is a consistent choice for this location.

Note
If you see 'Web Server not installed' in the script file path field, make sure that you have indeed selected the correct Web Server on the first page of the Wizard. If you are using IIS4 or 5 and you see this message, you can try explicitly selecting the Web site to install to on the first page by clicking on the Advanced tab and selecting the site.

Virtual Directory Name
This will be the virtual (logical) name for this directory in server relative terms. A virtual is similar to a drive mapping that logically describes an underlying path. It's highly recommended that you do not change this value from its wconnect default. If you do change this value the demos may not work since they use /wconnect as the server relative path to access the Web Connection DLL.

Step 4 - Finish and test the Server

Next Step



Ok, the final step of the Wizard asks you to click Finish to run the configuration process. Let 'er rip.

Important note for PWS on Windows 98
If you installed for Personal Web Server on a Windows 98 or 95 machine be sure to reboot your machine, since the registry settings made during install will not take until PWS is completely restarted. Rebooting is the only 'official' way to restart PWS, although you can also kill the process and then restart it.

Starting up the server


After the setup program is done it should pop up your new Web Connection server automatically as a standalone application running out of Visual FoxPro. It tries to run VFP in the current directory and simply runs the sample server immediately.

If you do this manually when you start up next time follow one of these steps:

Once you do this the server form pops up:

Click on the Status button to see the status information of the server that should display some of the information that you specified during the Wizard operation:

You can make additional configuration changes on this status form later on as well as retrieve information about individual requests.

Accessing the Web Connection Demos


The next step is to fire up your Web Browser and access the demo page. If you chose the default install options you should now be able to go to:

http://localhost/wconnect/default.htm

and access the Web Connection demo page. If this doesn't work please check the Troubleshooting section.

Scroll down to the first request Hello World with Web Connection.

If everything is working OK you should get a response page almost immediately that says Hello World from Visual FoxPro! followed by additional information about some of the server variables exposed by the server.

If this didn't work please see the setup troubleshooting topic.

Otherwise you're in business! Go ahead and browse around the demo page and check out some of the links. Note that most requests have a Show Code link on the bottom of the page that lets you quickly review the Visual FoxPro code that drives the request.

Back at the Web Connection Server


If you flip back to the Visual FoxPro instance that we started up at the beginning of this topic you'll find that there is now some request information in it like this:

00:07:33   wwDemo~ShowImage  - 0.022
00:18:26   wwdemo~TestPage~&Name=Rick&Company=West+Wind  - 0.040

Each request that hits the server shows in the main window along with the time that it took to run. At the same time the request gets logged into a log file where you can review and summarize the incoming requests. You can access this log file from the admin page at http://localhost/wconnect/admin.asp and the Show Web Connection Request Log request.

The admin page allows a number of administrative tasks from server monitoring to setting configuration options remotely over the Web to changing operational modes of the server. It's a good idea to shortcut this page in your Favorites list.

Step 5 - Checking out the code

While most of the demo page links contain the Show Code links that let you review the code for most requests, there's no substitute for getting your hands dirty and stepping through some code and maybe even modifying it a bit.

The Web Connection Server started with the DO WCDEMOMAIN command runs a VFP program. The demo application is also a PRG file that you can edit. So,


  1. Shut down the Web Connection Server by clicking on the Exit button.
  2. Open up wwDemo.prg with MODIFY COMMAND wwDemo.
  3. wwDemo.prg contains a large class called wwDemo with methods for each of the request links from the Web page.
  4. Find the ShowHours() method in the class (right click in the editor- Procedure|Function List and find wwDemo.ShowHours).
  5. At the very top add SET STEP ON into the code.
  6. Save the file.
  7. Restart the server with DO WCDEMOMAIN.

  8. Flip over the HTML Demo page
  9. Find the Simple Data Query Example and enter B to search for and a date range that's reasonably recent.
  10. Click on the Show Hours button

If you go back to Visual FoxPro now you should find the debugger popping up on the SET STEP code that we just inserted:

You can now happily step through the code line by and see the operation of each request as it happens. For example, you can now see the content of the request variables

lcOrigClient=Request.Form("Client")
lcDate1=Request.Form("StartDate")
lcDate2=Request.Form("EndDate")

being filled and the SQL WHERE clause being built and then rendering the code with ShowCursor().

As you just saw making a code change is very easy - you simply change the PRG file, save it and start up the server again. You don't need to recompile (although you could recompile the WCDEMO project everytime) and the changes take immediately.

Error Handling in Web Connection


Now go back into that code and take out the SET STEP ON. Instead put in some bogus code like:

o=CREATEOBJECT("NonExistingObject")

Guess what will happen here? The code will fail because this object doesn't exist and a VFP error occurs. VFP pops up an error dialog ontop of the editor with the code highlighted:

This is great for debugging - certainly beats typical COM debugging that doesn't allow you to debug a compiled object at runtime, right.

While this is nice for debugging if this occurs on your live Web site, this would be a problem though. I know you don't make coding mistakes ever <s>, but there are system circumstances or typos etc that do slip into production code. A stop error as we're seeing above would lock the Web Connection server dead in its tracks - it wouldn't be able to take any more requests until the dialog is closed.

In order to work around this Web Connection has a configuration setting that allows you to switch between debug and live modes. You can find this flag in WCONNECT.h:

#DEFINE DEBUGMODE      .T.

By default Web Connection ships with this flag set to .T. which makes errors basically stop on the offending line of code, since this is great for debugging. In order to switch this flag into deployment mode set the flag .F. and recompile your project. It's very important that you recompile the project completely with:

BUILD EXE <projname> FROM <projname> RECOMPILE

or by using the Recompile All option from the Build dialog.

Rerun the program now by running the EXE file:

DO WCDEMO

Now re-run the request. You'll find that Web Connection now handles the error and passes back an error page that describes the error on the Web page:

This is obviously much nicer than the server crashing and hanging situation we encountered before. What happens behind the scenes is that the Web Connection error methods kick in and generate this HTML output page. The page can be customized by overriding the wwProcess::ErrorMsg() method in your subclass of it. In fact you can also override the error behavior to perform other tasks on errors, but there's not a lot you can do but display some error info. Once the error page is generated the code returns back to the mainline and the error page is returned to the Web browser.

Note: The Shareware version is precompiled, so the #DEBUGMODE flag cannot be set and recompiled. The Shareware version will always stop on any VFP errors in your code.

Setup troubleshooting

The setup program will handle all configuration issues for all Microsoft Web servers as well as Apache. However, it's possible that due to particular system settings several options may not be available to get all of the settings installed resulting in the server not operating correctly.

This section describes several possible problem scenarios.

Troubleshooting a Filebased Server Install

When you install Web Connection it defaults into File based communication and a file based server requires that it can communicate with the Web Server via message files. There are a few things that can go wrong here either because a step was missed during setup or because a service is not running.

Is your Web Server working?
First of all make sure that you can indeed get to the Web Connection demo page by typing
http://localhost/wconnect/default.htm (or use the IP address or machine name instead of localhost). If this doesn't work your Web server is not functioning correctly. Check your Web server install docs to get the server working first.

Temp Directory Permission
If you get an error that states that you don't have permissions for your temp directory immediately, make sure that the temp path you've chose supports FULL access for the IUSR_ anonymous Web account. wc.dll requires this in order to write temporary message files when running in file based messaging.

Is the Web Connection Server running?
Next, make sure that the Web Connection server is running in a Visual FoxPro session. The demos are set up to run file based and they require that the Web Connection server is manually started and running in the background. You can do so by starting Web Connection from the desktop or start menu shortcut and using the Web Connection menu to click on Web Connection Demo Server. See Step 4 of the Setup program for details.

Is the ISAPI DLL firing?
If the server is running and still no requests are hitting the server try the following URL:

http://localhost/wconnect/wc.dll?_maintain~ShowStatus

If this URL is not working there's a fundamental problem on the Web Server in accessing the DLL. Follow this link to Manual Server Configuration for more details.

It's still not working - now what?


Ok, the above makes sure that the platform is properly configured. Let's make sure Web Connection is properly configured. To do this we want to make sure that the server's configuration file (YourApp.Ini or in the case of the demo WcDemo.Ini) and the Web Connection DLL INI file (wc.ini) are synched up properly.

Start by running your Web Connection Server with Do <yourAppMain.prg> and bring up the Status form as shown in the image below. Make sure that the startup path shown in the form matches your actual startup path - if for some reason it doesn't change it to the install directory and Save Settings.

Next bring up the Admin page for your the demo or your application by going to:

http://localhost/wconnect/admin.asp

(or go to your application's admin.asp page). Click on Show and Manage ISAPI settings. We can now compare settings between the Web Connection server and the wc.dll setting the Web Connection DLL is running.

Pay attention the Temp File path and Templates - they should match in both places. Case won't matter, but make sure they are otherwise the same. If they are not we need to sync them.

Changing the your server's settings
To make changes to the application's INI file simply change the value on the Status form and click the Save Server Settings button. When you exist the form these settings should be live. These settings are written into your application's ini file (<yourApp.ini or wcDemo.ini for the demo app).

[Main]
Tempfilepath=d:\temp\wc\
Template=WC_

Changing the wc.ini settings
To make changes to the Web Connection ISAPI INI file find wc.ini in your Web directory or the bin directory. Open the file with a text editor or the Visual FoxPro editor.

[wwcgi]
Path=d:\temp\wc\
Template=wc_

You'll want to change the Path and Template keys to match the value from the server.

Once this change has been made, go back to the ISAPI DLL Admin page and click on the Re-Read Configuration button, which loads the new settings. Verify that the settings are changed in the status display.

Authentication Dialog with NT and Windows 2000

If you see an authentication dialog pop up for non-protected Web Connection DLL or script links it most likely means one of the following:

The Web Connection Setup, New Project, New Process and Configuration Wizards all automatically apply these settings for IIS.

Request does not support this method... Error Page

This is a Web Connection generated error message and means that you're getting to Web Connection's code. This error means that you're not set up to handle a specific request parameter and most likely means you typed in the URL manually. What you're actually seeing is a Web Connection error handler that kicks in on invalid or non-existant requests.

These parameters are passed (by the demo at least as: wc.dll?Project~Method~Parameters). The Project name is added in the wcDemoServer :: Process() method in the CASE statement. The second parameter is handled by your processing code in the wwProcess :: Process() method and needs to correspond to a method in the class that handles requests. If the class does not exist you get the error.

To fix make sure you have set up an entry in the Server's Process CASE statement and you have a matching method in your custom Process() class. For more info, see the section