I am working on a project which connects clients' PCs with Server by using Windows and web service.
The idea came when I had to make an order from a restaurant call center, by using XML files and avoid network problems and support parallel requests.
- (Windows service, web service) as core operation
- Windows application as (user interface, monitoring and notifications)
- System tasted & worked fine using:
- C# for all sections
- Microsoft CLR1.1
- Visual studio.NET 2003
The code begins when Action is done & a file released on Server1.[Send folder], then server1 tries to send it to the required server via web service, in case of failed sending, then send data to "Retry" system which works in parallel with the basic system.
- * retry system, retry sending the data for n times, then send the data (if failed to send by retry system) to faxing system,
- * fax system try to send data
If failed retry faxing (n) times then dump data to failed folder and create report
- If success to send, then web service on the client computer dumps the data on a client.[received folder] or server2.[received folder]
- When this is done, a fie watcher on the client computer takes the file received on the [received folder] and does whatever action
... then reverse way starts
- Server2 or client computer sends a file to [send folder]
- Windows service file Watcher catches it and tries to call web service placed on server1 exactly like what was done on the server1.
- When server1's Windows service feels received files sent by server2 via web Service and does whatever action is based on received data.
Monitor and Notification Systems
The system is divided to 2 parts:
- Core system (Windows service and Web service)
- Interface system (Windows applications "
It is the name in the attached project "windows Service and Windows Interface".
This application is used to control windows service (stop/run), and monitor client connectivity (by trying to call a function on the web service over target PC "Is Connected" that returns
And configuration interface that defines:
- retry system values
- paths for sending and receiving folders
- registered servers (names and IPs)
And any others values like retry due, interval, faxing retry,... etc.
This system is inside the monitor system, but it's abstractly a system that has a file watcher on a folder (notification).
When windows service wants to alert for an event to the user, it places a file that has alerting information in the notification folder.
Then file watcher catches it & notifies the user.
It's also customizable to put any images / delay / etc. all by INI file attached.
I'd like to thank John O'Byrne for his article: Taskbar Notify.
It helped me a lot on this section, but I added some additional options like dynamic skinning.
I also attached SQL server database to control Notifies With remembers Missed notifications and alarms, so you can restore them later.
Using the Code
"If you want to change the place of the Config files c:\Server1\settings, you can do it from structures class (config structure) on both Monitor and Windows service applications".
A brief description of how to use code is given below:
easy use But it takes structure contains all properties that event can have for example :
StructDisplayInfo inInfo = new StructDisplayInfo();
inInfo.popupTitle = title; inInfo.popupPrifeInfo = prifeInfo;
inInfo.TypeInt =(int) StructDisplayInfo.Typeenum.Notify;
NotifyMe myNotify = new NotifyMe(inInfo);
this one I think have Full properties
StructDisplayInfo inInfo = new StructDisplayInfo();
inInfo.TypeInt = (int)type;
inInfo.popupPrifeInfo = prifeInfo;
inInfo.Maintitle = formMainText;
inInfo.lblDetails = lblDetails;
inInfo.details = Details;
inInfo.DateTimeOfEvent = EventDateTime;
inInfo.ServerIP = ServerIP;
inInfo.ServerName = ServerName;
inInfo.Info1 = info1;
inInfo.lblInfo1_title = lblInfo1;
inInfo.Info2 = info2; inInfo.lblInfo2_title = lblInfo2;
inInfo.Footer = footer;
inInfo.AddtoDatabase = AddtoDatabase;
SET UP Project Steps
To setup this project, you have to:
- Place the folder Server1 on the c:\ (You can configure later).
- From c:\Server1\Settings\, you can configure all paths and settings related to the system, from 2 INF files:
- "MonitorConfigrations.ini" for Monitor system and notification, and Monitor Database Connection string (database attached on: Server1\Database\myDatabase_Data.MDF)
- "inf.ini" for Servers, retry and other core settings
- Setup the database in your SQL server (it's for remembering missed Events) one table, so you can join it with your already made database and setup its connection string on "MonitorConfigrations.ini"
- Setup the Windows service: "Server1WindowsSevice.exe"
Using the Installutil.exe supported with .NET Tools.
- Setup XML Web service on your IIS or on another Machine (and remember to send it to the inf.ini).
IP2=...... (have to be the full address of the target web service)
Server2=myPC(just a Nike name )
Then run the Windows service... it should work fine.
Then about the User interface, it's on this file: "winServiceAndWindowsInterface.exe".
You can run it easily. It will appear in the task bar & will control and monitor the job.
Points of Interest
The project is full dynamic using Multi threads specially when it check status of all servers every interval, check them all at once (not sequential). Also dial with servers and Windows/Web service and control them and retry when connection failed, etc.
I am looking for:
- Enhancing user Interface Windows application
- Include user Interface for client PC too
- Enhance event notification system
- Sure your comments for any upgrade ideas
- 15th August, 2010: Initial post