Assembly: mindtouch.core
Class: MindTouch.Dream.HostService
SID: http://services.mindtouch.com/dream/...e/2007/03/host
The Host service provides an interface to start and stop services. Before a service can be started, its blueprint must be registered through one of two mechanisms: full-registration or self-registration.
As the name implies, full-registration requires all details of the service to be specified upfront (assembly, type, name, copyright, features, etc.). Self-registration, on the other hand, only requires the assembly and type information, but assumes that service class was defined using DreamService and DreamFeature attributes.
Once a blueprint has been registered, services can be instantiated.
| Verb:Suffix | Description |
| GET:blueprints | Retrieve list of all blueprints. |
| POST:blueprints | Register a service blueprint. |
| DELETE:blueprints/{sid-or-typename} | Remove a service blueprint. |
| GET:blueprints/{sid-or-typename} | Retrieve a blueprint with given suffix as name. |
| POST:convert | Convert a document to another format |
| POST:execute | Execute an XML script. |
| POST:load | Load an assembly and register all contained services. |
| GET:services | Retrieves a list of all running services. |
| POST:services | Start a service instance. |
| POST:stop | Stop a service instance. |
| POST:shutdown | Shutdown host service and all running services. |
| *:test | Test communication with Host service. |
| GET:version | Retrieve version information about Dream assemblies. |
| POST:xmltransform | Apply a XML-transform (xslt) to a document. |
<config> <service-dir>C:/service_state</service-dir> <http-port>8081</http-port> </config>
<service> <uri>http://localhost:8081/myservice</uri> </service>
Partial Blueprint: a partial blueprint can be used for service classes that were defined using Dream attributes .
<blueprint> <assembly>dream.tutorial.8ball</assembly> <class>MindTouch.Dream.Tutorial.EightBallService</class> </blueprint>
Complete Blueprint: a complete blueprint specifies all the information required to instantiate a Dream service. The service class only needs to implement the IDreamService interface.
<blueprint>
<assembly Version="1.0.0.0" Culture="neutral" PublicKeyToken="null">dream.tutorial.8ball</assembly>
<class>MindTouch.Dream.Tutorial.EightBallService</class>
<name>Dream Tutorial 8-Ball</name>
<copyright>Copyright (c) 2006, 2007 MindTouch, Inc.</copyright>
<info>http://doc.opengarden.org/Dream_SDK/Tutorials/8-Ball</info>
<!-- the configuration element describes how to configure the service -->
<configuration>
<entry>
<xpath>nolog</xpath>
<valuetype>void?</valuetype>
<description>When present, service will not create a log sub-service at /@log.</description>
</entry>
<entry>
<xpath>uri.host</xpath>
<valuetype>uri?</valuetype>
<description>Uri for host service (provided by Host).</description>
</entry>
<entry>
<xpath>uri.self</xpath>
<valuetype>uri</valuetype>
<description>Uri for current service (provided by Host).</description>
</entry>
</configuration>
<!-- the 'features' element list all service features -->
<features>
<feature>
<pattern>GET:</pattern>
<description>Returns a random 8-ball message</description>
<info>http://doc.opengarden.org/Dream_SDK/Tutorials/8-Ball</info>
<method>GetAnswer</method>
<statusfilter>2xx</statusfilter>
</feature>
</features>
</blueprint>
<config> <path>8ball</path> <class>MindTouch.Dream.Tutorial.EightBallService</class> </config>
<script> <action verb="POST" path="/host/register"> <blueprint> <assembly>dream.tutorial.8ball</assembly> <class>MindTouch.Dream.Tutorial.EightBallService</class> </blueprint> </action> <action verb="POST" path="/host/start"> <config> <path>8ball</path> <class>MindTouch.Dream.Tutorial.EightBallService</class> </config> </action> </script>
<results>...</results>
Retrieve list of all registered blueprints.
| Status | Response Body | Description |
| 200 | Blueprint List | All blueprints currently registered with this host |
Aqua: feature added
Register a service blueprint.
Partial or Complete Blueprint
| Status | Response Body | Description |
| 200 | --- | --- |
Crimson: feature added
Retrieve the blueprint of a given serice type.
| Status | Response Body | Description |
| 200 | Blueprint | Requested blueprint if given name is currently registered with this host |
| 404 | HTML | Html error page. |
Aqua: feature added
Remove a service blueprint.
| Status | Response Body | Description |
| 200 | --- | --- |
Crimson: feature added
This feature is simply a passthrough. That is, it replies with whatever document is in the request body. Combined with the built-in Dream request processing parameters, it can be used to convert from any standard Dream format to any other.
Anything.
| Status | Response Body | Description |
| 200 | Same as request body. | By default, the response body is the same as the request body. |
Beryl: feature added
Execute an XML script.
Script
| Status | Response Body | Description |
| 200 | ScriptResults | A list of Result documents |
Aqua: feature added
Load an assembly and register all contained services.
| Name | Type | Description |
| name | string | Name of assembly to load |
| Status | Description |
| Ok (200) | (1-3 sentence description of response contents) |
Crimson: feature added
Register a service blueprint.
Partial or Complete Blueprint
| Status | Response Body | Description |
| 200 | --- | --- |
Crimson: feature is obsolete, use POST:blueprints
Aqua: feature added
Retrieves a list of all running services.
| Status | Response Body | Description |
| 200 | Service List | List of services currently running on the host |
Aqua: feature added
Start a service instance.
InitConfig
| Status | Response Body | Description |
| 200 | --- | --- |
Crimson: feature added
--- ---
Shutdown host service and all running services.
| Status | Response Body | Description |
| 200 | --- | --- |
Aqua: feature added
Start a service instance.
InitConfig
| Status | Response Body | Description |
| 200 | --- | --- |
Crimson: feature is obsolete, use POST:services
Aqua: feature added
Stop a service instance.
Service
| Status | Response Body | Description |
| 200 | --- | --- |
Aqua: feature added
This feature responds to any HTTP verb (GET, PUT, POST, etc.). The request body is optional and can be any valid XML document. The response is an XML document built from the requeset body and all included request headers. The response status code can be specified by the status query argument.
This feature has multiple uses:
| Name | Type | Defaut
|
Description |
| status | int? | 200 (OK) | Optional response status code to use for reply |
Optionaly, any valid XML document.
| Status | Response Body | Description |
| (any) | XMessage | The replied XMessage is an XML encoding of the request headers and the request body. |
Beryl: feature added
Remove a service blueprint.
Partial Blueprint. The <class> element is used as unique key to find the registered blueprint.
| Status | Response Body | Description |
| 200 | --- | --- |
Crimson: feature is obsolete, use DELETE:blueprints/{sid-or-typename}
Aqua: feature added
Retrieve version information about Dream assemblies.
| Status | Description |
| Ok (200) | (1-3 sentence description of response contents) |
Crimson: feature added
This feature applies the XSLT document provided by URI to the XML document in the request body.
| Name | Type | Defaut
|
Description |
| xslt | uri | (none) | Source location of XSLT document |
Any valid XML document.
| Status | Response Body | Description |
| 200 | Determined by XSLT | By default the, response body is expected to be a XML document. The respones type can be ovewritten by using the dream.out.type query argument. |
| 400 | Error message | When the XSLT document could not be found. |
Beryl: feature added