Accessing DSS Services through a Web Browser

Glossary Item Box

DSS User Guide: Accessing DSS Services through DSSP

See Also Microsoft Robotics Developer Studio Send feedback on this topic

Accessing DSS Services through a Web Browser

The Decentralized Software Services (DSS) service model is an extension of the classic Web architecture model. Thus, it is compatible with existing Web infrastructure allowing for integration with common tools such as Web browsers. For example, DSS can generate a User Interface (UI) in a manner that allows users to both access and update services directly through a Web browser.

Responding to HTTP GET Requests

Services can respond to HTTP GET requests in one of three ways depending on the HTTP request itself and which service handlers the service has registered to handle requests arriving on its main port. See DSS Service Components.

Note that if the Service State class is correctly annotated using the ServiceState attribute then there is no need to write handlers for the GET and HTTP GET requests -- the DSS base service class will handle these for you. It is even possible to specify the XSLT Transform to be used for HTTP GET requests. Refer to Service Tutorial 6 for more information.

HTTP Get Service Handler

If the service has registered a service handler for the Microsoft.Dss.Core.DsspHttp.HttpGet  Decentralized Software Services Protocol (DSSP) Operation on the main port of the service, it will respond to requests where the HTTP request Uniform Resource Identifier (URI) does not contain a query component. That is, an HTTP GET request, where the request URI does not contain a question mark (?) will be handled by this service handler.

An HTTP GET request is a request for the entire state of a service which means that a successful HTTP GET response contains a snapshot of the entire service state. The service state can be represented in an open-ended set of data formats ranging from XML, HTML, image formats, video, audio, etc. Most of the DSS System Services generate XML with an associated XSLT that converts the state into HTML for display in a browser. However, the WebCam Sample is an example of how to generate multiple data formats within an HTTP Get handler.

HTTP Query Service Handler

If the service has registered a service handler for the Microsoft.Dss.Core.DsspHttp.HttpQuery DSSP Operation on the main port of the service, it will respond to requests where the HTTP Request URI does contain a query component. That is for URIs that do contain a question mark (?). For example:

http://example.org/myservice?query=keyword

An HTTP Query request is a request for parts of the state of a service where the query is encoded as name-value pairs in the URI. As with the HTTP Get Service handler, the response to a query can be represented in an open-ended set of data formats ranging from XML, HTML, image formats, video, audio, etc. 

DSSP GET Service Handler

If a service has a service handler registered for the Microsoft.Dss.ServiceModel.Dssp.Get DSSP Operation on the main port of the service, but no HTTP Get or Query service handler it will still respond to regular HTTP requests. While DSSP GET semantically is identical to HTTP GET, the difference from the responses generated by HTTP Get and Query handlers is that the response is an actual SOAP envelope containing the state of the service within the SOAP body element.

Responding to HTTP POST Requests

Services can respond to HTTP POST requests if a service handler is registered for the Microsoft.Dss.ServiceModel.Dssp.HttpPost DSSP Operation on the main port. The service handler can either read the HTTP request entity as an unstructured stream or as a name value collection. The name value collection model is useful for HTML Form POST requests.

Responding to HTTP PUT Requests

Services can respond to HTTP PUT requests if a service handler is registered for the Microsoft.Dss.ServiceModel.Dssp.HttpPut DSSP Operation on the main port. The service handler would typically read the entire HTTP request entity as an unstructured stream and feeds it to some other stream acting as a data sink. An HTTP PUT request is a request for replacing the state of a service with the state included in the HTTP PUT request itself. HTTP PUT requests are supported by the Mount Service where the data is persisted to disk. This allows it to be retrieved later using a GET request. See DSS System Services.

See Also 

DSS User Guide: Accessing DSS Services through DSSP

 

 

© 2012 Microsoft Corporation. All Rights Reserved.