The following samples can only be run from a web browser connected to the sample Xb2.NET HTTP server (WEBSERVE.EXE). If you are simply browsing this file from the Windows explorer then do this:
Launch sample applications | ||
---|---|---|
Source Code | Sample | Description |
GetWeb.prg | GetWeb.exe | Execute an HTTP GET command, for example retrieve a file hosted on HTTP server. |
PostWeb.prg | PostWeb.exe | Shows how to POST a request to an HTTP server. |
Attach.prg | Attach.exe | Create a DIME payload containing several large files and upload to HTTP server. |
TServer.prg | TServer.exe | Simple Telnet server application. |
TClient.prg | TClient.exe | Simple Telnet client application. |
FTPTest.prg | FTPTest.exe | FTP client test application. |
SOAPExec.prg | SOAPExec.exe | SOAP client samples showing how to execute functions on remote servers. |
Web Basics | ||
Source Code | Sample | Description |
WebFunc.prg | Run a DOS Command | Get a directory listing of all files in HTTP server's executable folder. |
Execute a Codeblock | Execute an Xbase++ codeblock on server and return result to client. | |
Generate Error | Shows what happens when a runtime error occurs on the HTTP server.
|
|
Calculate CRC32 | Calculate CRC32 (Cyclic Redundancy Check) for a file. | |
Send Chunks | Shows how to send dynamic content incrementally. | |
Direct Function Call | Call an Xbase++ function and pass parameters to it directly.
|
|
WWW Basic Authentication | Brings up a login screen to authenticate a client using "WWW-Authenticate" basic authentication. Enter user name: "bugsbunny", password: "whatsup" (all lowercase). Using basic authentication you only need to log in once for the duration of the session. After entering your credentials, the browser automatically sends them on subsequent requests to the same domain. If you click the link again, the authentication dialog is no longer displayed. |
|
Upload File | Upload one or more files from client computer to server. | |
Session Management | Samples showing how to generate dynamic HTML, database access and use of HTTP session management. | |
ProgressBar.prg | Progress Bar | Display a progress bar that is updated by the server in real time (requires JavaScript support). |
TimeClock.prg | TimeClock application | Web based TimeClock application. |
HTTP Server Push Technologies | ||
Source Code | Sample | Description |
WebFunc.prg | AJAX Test | Ajax defines a web framework for dynamically pulling data from the server. Ajax makes it possible to update small sections of an HTML document with new data without requiring a complete page refresh. |
Comet Test | Simple example of how to implement server push also known as "Comet" and "reverse Ajax". The Comet
pattern is based on creating and maintaining long-lived HTTP connections that enable the server to
push events or data to the client without waiting for the client to request it.
|
|
WebSocket - enables persistent TCP connection between server and client | ||
Source Code | Sample | Description |
WebServe.prg | WebSocket Echo Server | Establish a long-lived WebSocket connection between a client and Xb2.NET HTTP server. Because the connection is established using regular HTTP (or HTTPS for security), it is able to traverse proxies and firewalls that would ordinarily block regular socket connections. Once the connection is opened, data can be streamed in either direction between client and server. |
WSChat.prg | WebSocket Chat Room | A simple chat room server using a WebSocket connection between web client and Xb2.NET HTTP server. |
WSClient.prg | WSClient.exe | xbWebSocket client-side test program. |
Compiled Xbase++ .PRG script
| ||
Source Code | Sample | Description |
Hello.prg | Hello | Dynamic HTML page generated by Xbase++ PRG script compiled on-the-fly. If the PRG is modified, the Xb2.NET
engine automatically recompiles it and the new code is loaded into memory (no need to restart the server).
|
Hello2.prg | Hello2 | Dynamic HTML page generated by Xbase++ PRG script compiled on-the-fly. If the PRG is modified, the Xb2.NET
engine automatically recompiles it and the new code is loaded into memory (no need to restart the server).
|
Colors.prg | HTML Colors | |
AjaxListBox.prg | Populate List Box using AJAX | Shows how AJAX can be used to fill a List Box on a web page with data fetched from the server. |
AjaxCalc.prg | AJAX Calculator | Use AJAX to send a simple string of data to the server, the server calculates the result and sends back the answer in the HTTP response. JavaScript is used on the client-side to display the result without refreshing the entire page. |
StatePersistence.prg | Page Load Counter | An example of how to maintain state persistence when the HTTP server is restarted or when a PRG script is modified and it's DLL is reloaded. |
Checkout.prg | Process payment using PayUnity service | A fully functional webshop checkout using PayUnity service: https://payunity.docs.oppwa.com/ |
UsingMacro.prg | Execute function in main .exe | This sample shows one way of calling functions found in the main .EXE from a .PRG script. |
Compile_err.prg | Compile error in .prg script | This sample shows how compile/link errors are displayed in browser when a PRG script contains errors.
|