Testing the StockBrokerNMO Sample Application


Testing the StockBrokerNMO Sample Application

The StockBrokerNMO sample application takes a number of command-line arguments, including the target SQL Server name, the credentials of the service account, and the SQL usernames and passwords to use for creating and running the instance. The C:\SQL-NS\Samples\StockBrokerNMO\Scripts directory contains a batch file that invokes the StockBrokerNMO program and passes the appropriate values for the command-line arguments, based on the development environment configuration you established in Chapter 2, "Getting Set Up." Use the following instructions to build the StockBrokerNMO application, run it with the batch file, and then test the StockBrokerNMO instance it creates.

1.

If you haven't done so already, open the StockBrokerNMO Visual Studio solution using the instructions given in the section "An NMO Sample Application," (p. 534).

2.

Build the StockBrokerNMO solution in Visual Studio.

3.

Open a Notification Services Command Prompt and navigate to the C:\SQL-NS\Samples\StockBrokerNMO\Scripts directory.

4.

Invoke the run.cmd script. The script will prompt you for the password of the service account and, if you're using SQL Server Authentication, the passwords of the development and test SQL Server accounts. It then starts the StockBrokerNMO program, passing all the required command-line arguments. Several of the argument values are obtained from the environment variables established when you set up your development environment.

5.

Wait for the StockBrokerNMO program to complete. When it is finished, the StockBrokerNMO instance will have been created, registered, and enabled.

6.

Run the T-SQL script, C:\SQL-NS\Samples\StockBrokerNMO\Scripts\SQLPermissions.sql in Management Studio. This script grants the necessary permissions for the service to access the newly created instance database.

7.

Start the SQL-NS Windows service for the StockBrokerNMO instance using the following command:

 net start NS$StockBrokerNMO 


8.

Run the T-SQL script C:\SQL-NS\Samples\StockBrokerNMO\Scripts\Test.sql in Management Studio. This script enters some sample subscribers and subscriptions and then submits a set of test events.

9.

Observe the contents of the file C:\SQL-NS\Samples\StockBrokerNMO\FileNotifications.txt. Within 30 seconds, notifications should be written to this file.

As this sample shows, a SQL-NS instance created using the NMO API behaves exactly like one created via the standard SQL-NS tools. In fact, the StockBrokerNMO instance can now be managed like any other SQL-NS instance, using those standard tools.

When you're done working with the StockBrokerNMO sample instance, you can remove it from your system by running the script cleanup.cmd from C:\SQL-NS\Samples\StockBrokerNMO\Scripts.




Microsoft SQL Server 2005 Notification Services
Microsoft SQL Server 2005 Notification Services
ISBN: 0672327791
EAN: 2147483647
Year: 2006
Pages: 166
Authors: Shyam Pather

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net