______________________________________________________________________________
<ws>namespace − commands |
TWiST is a front-end toolkit for rapidly deploy Tcl procedures as a web service. The simplified API of TWiST consists of only three procedures: <ws>namespace, <ws>proc and <ws>return. The names reflect the underlying Tcl commands. <ws>namespace commands are used to establish and maintain the web service. |
<ws>namespace init tclNamespace <ws>namespace schema tclNamespace targetNamespace <ws>namespace import tclNamespace fullyQualifiedProcName ?returns? ?typedReturnList? <ws>namespace finalize tclNamespace <ws>namespace freeze tclNamespace <ws>namespace unfreeze tclNamespace <ws>namespace set tclNamespace variable ?value? <ws>namespace lappend tclNamespace variable value <ws>namespace eval tclNamespace body <ws>namespace delete tclNamespace _________________________________________________________________ |
The TWiST API enables rapid deployment of Tcl procedures as a web service. Currently TWiST runs as an AOLserver module and uses AOLserver as the HTTP server for request and response. TWiST is non-invasive: the API is used in a Tcl script in the pageroot of the AOLserver. The location of the Tcl script file becomes the address of the web service. In addition, the developer does not have to modify any existing code. The TWiST API is best considered as a configuration of an interface. This allows the interface and the internal API to vary independently and maintains separation between code and configuration. Once a web service is defined in a Tcl page via the TWiST API, visiting the page with a web browser will return a list of operations available, links to more information for each operation, and a link to the Web Service Description (WSDL) of the web service. The operation links can be followed to display an example SOAP Request to invoke the operation. This link also provides a form which can be used to submit parameter values, invoke the service and display the actual SOAP Request and SOAP Response. |
<ws>namespace init |
Creates the Tcl namespace and sets up a few namespace variables. |
<ws>namespace schema |
Initializes the XML-Schema Namespace so types can be defined prior to use by <ws>proc and <ws>namespace import. The targetNamespace is also changed to the provided value. Developers should use this command any time either <ws>type or <ws>element are called prior to calling <ws>proc or <ws>namespace import. |
<ws>namespace import |
Provides a simple method for adding an existing procedure from another namespace to the web service. |
<ws>namespace finalize |
Once all procedures have been added to the web service, finalize handles the grouping and binding of the procedures into a web service. |
<ws>namespace freeze |
Blocks any further modifications to the web service. Use the freeze command after development is complete. The command prevents execution of the defining scripts. However, developers may need to restart AOLserver if types or proc signatures change. Also note that threads will exit within a few minutes, providing the same effect as restarting. |
<ws>namespace unfreeze |
Unblocks editing of the web service. |
<ws>namespace set |
Either sets or returns the value of a web service variable. |
<ws>namespace lappend |
List appends an element to a named web service variable. |
<ws>namespace eval |
Executes the same as namespace eval (unimplemented). |
<ws>namespace delete |
Deletes the namespace and the associated web service (unimplemented). |
Hello World! Example: |
<ws>namespace init ::MyWebService <ws>proc ::MyWebService::HelloWorld { } { return "Hello World!" } returns { Listen } <ws>namespace finalize ::MyWebService <ws>namespace freeze ::MyWebService <ws>return ::MyWebService |
tclNamespace |