Notification Services is one of SQL Server's newest features. This is collection of technologies allows developers and administrators to create applications based on SQL Server that notify users when specific events occur. Notification Services can be integrated and developed in dotnet application to simpler Notification related Applications.
Notification Services
1. Install SQLXML & Notification Services SDK from Microsoft website http://www.microsoft.com/sql/ns/
In Notification Services there are three regions to identify · Client who interact with the application · Notification services Database · An administrator who creates Subscribers and Subscriptions Also events
Consider a simple scenario, A Subscriber “ABC” has registered himself to get Notified whenever Stock value for Item “Item1” exceeds 100. In this case administrator create a Subscriber “ABC” for Stock symbol “Item1” with value 100 and creates events. Like wise administrator can create as many number of subscribers depending on request and also can specify the mode of Notification
It is pretty difficult to start with Notification Services because there is no simple documentation on any website. I have prepared a document on this to simpler the steps needed for using Notification Services.
You can download my sample application from my site : http://www.geocities.com/nirmala792004/index.htm
Classes in Microsoft.SqlServer.NotificationServices 1. NSInstance – Notification Services instance 2. NSApplication 3. NSUtility
Architecture
The following terms need an introduction to understand the architecture. · Event: An event is an action that occurred affecting the specified data. · Subscriber: Subscriber is an entity interested in being notified when an event occurs. · Subscription:Subscription is an act by which subscriber describes when and what he wants to be notified as. (Subscriber specifies that he wants to be notified when stock price goes more than $100.) · Notification: Notification is a mode/channel of communication. Email, SMS, data files are a few examples.
In Notification Services we mainly work around 2 files 1. ADF – Application Data File, it is an xml file 2. Configuration file – it is an xml file
Steps to Create Notification Services
(You can download the zip file that I have created a sample application on Notification services from site visit http://www.geocities.com/nirmala792004/index.htm . ADF and Config xml files are included )
1. Create SampleNSTestADF.xml (contain application and DB definition) 2. Create SampleNSTestConfig.xml and copy in base directory of Notification Services C:\Program Files\Microsoft SQL Server Notification Services\v2.0.3008.0
3. Create Notification Instance that is defined in SampleNSTestConfig Using nscontrol create command (run this command at basepath of NS) Goto Notification services command prompt C:\Program Files\Microsoft SQL Server Notification Services\v2.0.3008.0> and run the following commands nscontrol create -in SampleNSTestConfig.xml -sqlusername NS -sqlpassword ns
output :
Creating instance SampleNSTestInstance
Creating application Application name: SampleNSTest
Create successful.
4. Register Notification Instance using nscontrol register nscontrol register -n SampleNSTestInstance -s Transcore -service -sqlusername NS -sqlpassword ns output: successfully Registered
5. Start the service NS$SampleNSTestInstance (that created after registering instance)
6. Enable the Instance using nscontrol enable nscontrol enable -n SampleNSTestInstance -s Transcore
output: Status of instance "SampleNSTestInstance":
Subscribers: Enabled
Application: SampleNSTest Hosted event providers SampleNSTestEP (NIRMALA-XP): Enabled
Non-hosted event providers WebEventCreator : Enabled
Generator SampleNSTestGen1 (NIRMALA-XP): Enabled
Distributors SampleNSTestDist1 (NIRMALA-XP): Enabled
Subscriptions: Enabled
Windows services NS$SampleNSTestInstance (NIRMALA-XP): The service is running
7. Now it is ready to use Notification Service class objects to Create subscribers & Subscriptions, and adding trigger values 8. Create Events
Please feel free to contact Nirmala792004@yahoo.com, Pls. give feed back on this article
|
| Author: S. Suresh 04 Nov 2004 | Member Level: Gold Points : 0 |
Good article this is....Hope this will be useful for people who are going to work on advanced applications...
|
| Author: pinaki nag 01 Dec 2004 | Member Level: Bronze Points : 0 |
it was a good article . but nirmala please answere my mails i have sended two mails to you please can you help me
|