Build unmanaged services

Most sample services are managed services. They must run on the same system node as the PureWeb server, and the server automatically handles the application/process life cycle.

The C++ and .Net Scribble sample service on Windows, however, can also be deployed as an unmanaged service, which makes it possible to have the PureWeb server and the service application on different nodes. Unmanaged services must be started and stopped outside of PureWeb. See About the connection workflow.

This section provides the instructions for building and deploying Scribble as an unmanaged service on Windows.

Unmanaged services are not currently supported in Java.

Steps

Build the service

The instructions are very similar to those for building a managed service, except that you must provide the PureWeb server's IP address manually, so that the service can find it.

C++

The C++ sample service on Windows is packaged as a Visual Studio solution.

  1. Navigate to the location of the source files:
    [install_path]\SDK\Samples\Scribble\ScribbleAppCpp
  2. Double-click the ScribbleApp2010.sln file to open it in Microsoft Visual Studio.
  3. Specify the IP address of the PureWeb server:
    1. In Visual Studio's Solution Explorer pane, right-click the ScribbleAppCpp project and select Properties.
    2. Navigate to Configuration Properties | Debugging.
    3. In the Command Arguments property, type the following, replacing [Server IP Address] with the actual IP address of your PureWeb server:
      /PureWeb /Server=[Server IP Address]

      Note the space between /PureWeb and /Server.

    4. Click Apply to apply your changes and click OK to close the properties dialog box.

  4. Go to the Build menu, then select Build Solution. You can keep an eye on Visual Studio's output pane, which will confirm if the build was successful.

This will place the files for your service at this location:
[install_path]\Server\bin\ScribbleAppCpp

It also adds the application plug-in file to the PureWeb server:
[install_path]\Server\conf\ScribbleAppCpp-plugin.xml

.Net

The .Net sample service on Windows is packaged as a Visual Studio solution.

  1. Navigate to the location of the source files:
    [install_path]\SDK\Samples\Scribble\ScribbleAppCSharp
  2. Double-click the ScribbleApp2010.sln file to open it in Microsoft Visual Studio.
  3. Specify the IP address of the PureWeb server:
    1. In Visual Studio's Solution Explorer pane, right-click the ScribbleApp2010 project and select Properties.
    2. Select Debug to view the debugging properties.
    3. Under Start Options property, in the Command line arguments box, type the IP address of the PureWeb server.
    4. Save your changes and close the properties dialog box.
  4. Go to the Build menu, then select Build Solution. You can keep an eye on Visual Studio's output pane, which will confirm if the build was successful.

This will place files for your service at this location:
[install_path]\Server\bin\ScribbleApp

It also adds the application plug-in file to the PureWeb server:
[install_path]\Server\conf\ScribbleApp-plugin.xml

If the server is already running, you do not need to restart it. Instead, simply reload the plug-ins (navigate to the server's Configuration page and click the Reload Plugins button). Otherwise, if the server is not running, start it now and log in.

You may see the sample service in the Apps page of the PureWeb server, under Available Managed Applications. This is because the samples are designed to work both as managed and unmanaged.

You must manually start the service as described in the next section before the service runs as unmanaged and clients can connect to it.


Start the service

In an unmanaged service scenario, the PureWeb server does not automatically handle the life cycle for your application. Instead, an external entity (the end user, or another process or application) must launch the service application first, before clients can connect to it.

Here's how you can manually launch your sample service as an unmanaged application.

C++

You can run the service directly from Visual Studio, or through the Windows command prompt.

In Visual Studio:

  • Since you already specified the IP address of the PureWeb server in Visual's Studio properties earlier, simply click the Run button to launch Scribble.

In the Windows command prompt:

  • Navigate to:
    [install_path]\Server\bin\ScribbleAppCpp

  • Type the following command to launch the service, replacing [Server IP Address] with the actual IP address of your PureWeb server (note the space between the arguments):
    ScribbleAppCpp.exe /PureWeb /Server=[Server IP Address]

To close the service once you no longer need it, right-click the service's icon in the Windows task bar and select Close Window.

.Net

You can run the service directly from Visual Studio, through the Windows command prompt, or through Windows Explorer.

In Visual Studio:

  • Since you already specified the IP address of the PureWeb server in Visual's Studio properties earlier, simply click the Run button to launch Scribble.

In the Windows command prompt:

  • Navigate to:
    [install_path]\Server\bin\ScribbleApp

  • Type the following command to launch the service, replacing [Server IP Address] with the actual IP address of your PureWeb server:
    ScribbleApp.exe [Server IP Address]

In Windows Explorer:

  • Navigate to:
    [install_path]\Server\bin\ScribbleApp

  • Double-click the ScribbleApp.exe file to launch it.

To close the service once you no longer need it, right-click the service's icon in the Windows task bar and select Close Window.

You should now see your sample service application listed under Queued Unmanaged Applications in the Apps page of the PureWeb server.