Click here to Skip to main content
15,891,951 members
Articles / Web Development / Apache

The platform-independent code with Mono: Client-server application sample

Rate me:
Please Sign up or sign in to vote.
4.80/5 (23 votes)
24 Mar 2010CPOL10 min read 74.2K   798   59  
This article shows how we can develop the platform-independent software with Mono usage
<%@ WebService Language="C#" Class="InfoCenter.WebConsole.InfoCenterService" %>

using System;
using System.Web.Services;

using NHibernate;
using InfoCenter.Logic;
using InfoCenter.Persistence;
using InfoCenter.Persistence.Core;
using InfoCenter.Persistence.Entities;

namespace InfoCenter.WebConsole
{
	internal class InfoCenterService
	{
		private PacketParser pp;
		
		IRepository<Computer> computers;
        IRepository<Process> processes;

		protected ISessionFactory sessionFactory;
		
		public InfoCenterService()
		{
			sessionFactory = Initializer.GetSessionFactory(false);
            computers = new Repository<Computer>(sessionFactory);
            processes = new Repository<Process>(sessionFactory);
            pp = new PacketParser(computers, processes);
		}
		
	 	[WebMethod(Description = "This method insert information about computer")]
        public void AddInfo(string compressedXml)
        {
			pp.AddInfo(compressedXml);
        }

        [WebMethod(Description="This method insert processes from a computer")]
        public void AddProcesses(string compName, string compressedXml)
        {
			pp.AddProcesses(compName, compressedXml);
        }
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Nokia
Germany Germany
Interested in design/development of framework functionality using the best patterns and practices.

Comments and Discussions