Home · Modules · Classes · Namespaces · Functions

Web Service Framework

Webkit brings the Web to Qt, and QxtWeb brings Qt to the web. It lets you create web services within the Qt Toolkit. Typicall you'd implement a "Website", but its flexible enough to to let you mix websites with other content, other connection protocols, and other clients.


At first, there is a QxtAbstractWebSessionManager. Typically you would use a QxtHttpSessionManager which utilizes http cookies, but it is entirely possible to use different session techniques. The session manager starts a session either by just asigning it a number you can later use to identify sessions, or by instantiation a session stack (if you set serviceFactory). The former is more like the traditional webapp flow, where a request does not leave any traces other then some persisted session data, after it is handled. The later technique leaves qobjects in the main memory for the time of the session. They can handle background tasks for the specific session, and even later notify the session user asyncronously. However, it does come at a cost.

Connectors. Protocol implementations.

Qxt can connect your services with a range of protocols. Currently those are Http and Scgi. It is not recommended to run the http connector directly as a frontend service on the internet. Instead use it for development, or on embedded devices within a trusted network. Scgi allows easy integration into frontend servers, such as apaches httpd.

The Services.

Finally, you will want to implement one or many QxtAbstractWebService which handle the actual requests from clients. Your service then receives a pageRequestedEvent, with the request from a client. It responds to it by posting a response via postEvent. Note that the default event distribution is single threaded. Blocking a service will block the entire server. However, you will rarely find sitations where you have to block, thanks to Qts excellent asyncronous api. A few convenience implementations are provided, such as qxtwebservicedirectory.html, qxtwebcgiservice.html,qxtwebslotservice.html

See also QxtWeb.

Copyright © 2007-2010 Qxt Foundation
Qxt 0.7.0