DSS New Service Generation Tool (DssNewService.exe)
Glossary Item Box
DSS User Guide: DSS Service Projects Overview
Microsoft Robotics Developer Studio | Send feedback on this topic |
DSS New Service Generation Tool (DssNewService.exe)
The Decentralized Software Services (DSS) New Service Generation tool creates a new service project which you can use as the starting point for writing a new service. The project can be opened in Visual Studio but you can also edit it in any other source code editor. Similarly, the service can be compiled in Visual Studio or from the command line using the .NET Framework SDK. Note that DssNewService is a command-line tool for creating new services. You can also create new services using a Wizard in Visual Studio.
<strong>dssnewservice.exe</strong> [options]
Parameters
Option | Short Name | Description |
---|---|---|
/alt: ExamplesFrom the Microsoft Robotics Developer Studio Command Prompt, the you can use the simplest example of creating a VB.NET service template project called MySampleVB or use a C# service template project called MySampleCS in respective folders of the same name. For C#:
For VB.NET:
These commands create folders called MySampleCS and MySampleVB respectively that contain Visual Studio project files. Even though a generated service only contains the skeleton of a service you can compile it directly from the command line using msbuild or from within Visual Studio. From the command line you can compile the C# service like this:
Once it is compiled, you can start the service using the DssHost utility:
Then you can examine it using your Web browser by using the following URL: https://localhost:50000 and looking in the section Running Services. Another common example is creating a service that implements a specific service contract. For this you first need to determine which service contract you want to implement. The DssInfo utility is useful for inspecting a service assembly. The information can be written to an XML file or a HTML file (or set of files if the DLL contains more than one service). The following example shows how to pick a service contract from the RoboticsCommon DLL. First run DssInfo:
The output is an XML file called c:\temp\RoboticsCommon.xml that you can open in a web browser. You can open XML files in Notepad or a web browser. Locate the service that you are interested in and find its Contract Identifier in a <contract> tag. Here is a section of the XML file for the Motor service as displayed in Internet Explorer:
The Motor service has the contract identifier: https://schemas.microsoft.com/robotics/2006/05/motor.html Now run DssNewService indicating that you want to implement the motor service as follows:
When you use the /alt command line argument, DssNewService generates a service project that contains stubs for all the service handlers defined in the specified contract. The generated project is available in the MyMotor folder and can be compiled using the following commands.
Again, you can start the service using the DssHost utility:
Finally, open your Web browser and point it at https://localhost:50000 then look in the Service Directory to see the new service. Note that there will be two instances of the service, one which matches the alternate contract and the other which is a new service with its own set of operations.
DSS User Guide: DSS Service Projects Overview
© 2012 Microsoft Corporation. All Rights Reserved. |