Running the Simulation
Once the code has been successfully compiled, you can run the simulation by clicking F5 to start debugging or Ctrl+F5 to start without debugging. The application should display a command window and take a few seconds to load files for the service. Once the service is completely loaded, you should start seeing mouse position coordinates displayed every one second in the Visual Studio Output window. The command window should also display the message, "Manifest load complete."
As mentioned previously, the mouse position is displayed as output from debug. Alternatively, you can query the state for the service, by opening a web browser and navigating to the following URL:
 | |
Figure 3. The Final Results: The web browser results after querying the state for the MouseTracker service. |
http://localhost:50000/MouseTracker/
Depending on your operating system, you may need to enter authentication information for your development machine. The final result should look similar to
Figure 3. Notice that the
X and
Y mouse coordinates are displayed as formatted XML. If you move the mouse and then click refresh, you should see the coordinate values change.
What Else Could Be Done with This information?
In addition to displaying the information in an Output window or a web browser, you could also create a second service that established a partnership with this service. The second service could then subscribe to the first service and receive notifications when the state changed.