Show/Hide Toolbars

TMS XData Documentation

Navigation: Basic XData Programming

Creating an XData Server

Scroll Prev Top Next More

TMS XData Server is based on the TMS Sparkle framework. The actual XData Server is a Sparkle server module that you add to a Sparkle HTTP Server.


Please refer to the following topics to learn more about TMS Sparkle servers:


Overview of TMS Sparkle HTTP Server

Creating an HTTP Server to listen for requests

TMS Sparkle Server Modules


To create the XData Server, just create and add a XData Server Module (TXDataServerModule class, declared in unit XData.Server.Module) to the Sparkle HTTP Server. The following code illustrates how to create and run the server. Note that the code that creates the XData server module is not displayed here. You should refer to the "XData Server Module" topic to learn about how to create the module:


  Sparkle.HttpSys.Server, XData.Server.Module;
function CreateXDataServerModule(const BaseUrl: string): TXDataServerModule;
  // Create and return the TXDataServerModule here,
  // using the BaseUrl as the server address
  Module: TXDataServerModule;
  Server: THttpSysServer;
  Server := THttpSysServer.Create;
  Module := CreateXDataServerModule('http://server:2001/tms/xdata');


The code above will create and start an XData server that will receive and respond to HTTP requests at the address "http://server:2001/tms/xdata".