Click here to Skip to main content
15,885,780 members
Articles / Programming Languages / C#

Extensible WebService and its IE-Hosted Client

Rate me:
Please Sign up or sign in to vote.
4.97/5 (33 votes)
2 Nov 200313 min read 59.5K   615   49  
The article presents the design of a WebService consisting of a general part and add-ins to process user's requests of different types. Such architecture simplifies dedicated add-ins allowing them to share general part facilities.
using System;
using System.IO;
using System.Xml.Serialization;

namespace ProcessorData
{
	/// <summary>
	/// Summary description for Data
	/// </summary>
	public class Data
	{
		private Guid guidClient;
		private Guid guidType;
		private string name;
		private string strServerObjectName;
		private string strCommandText;
		private int iCommandID;
		private string strResult;
		private string strError;

		public void Init(string name, string strServerObjectName, Guid guidClient, Guid guidType, 
								string strCommandText, int iCommandID)
		{
			this.name = name;
			this.strServerObjectName = strServerObjectName;
			this.guidClient = guidClient;
			this.guidType = guidType;
			this.strCommandText = strCommandText;
			this.iCommandID = iCommandID;
		}

		public int CommandID
		{
			get	{ return this.iCommandID;  }
			set { this.iCommandID = value; }
		}

		public string Name
		{
			get	{ return this.name;  }
			set { this.name = value; }
		}

		public string ServerObjectName
		{
			get	{ return this.strServerObjectName;  }
			set { this.strServerObjectName = value; }
		}

		public Guid GuidType
		{
			get	{ return this.guidType;  }
			set { this.guidType = value; }
		}

		public Guid GuidClient
		{
			get	{ return this.guidClient;  }
			set { this.guidClient = value; }
		}

		public string CommandText
		{
			get	{ return this.strCommandText;  }
			set { this.strCommandText = value; }
		}

		public string Result
		{
			get	{ return this.strResult;  }
			set	{ this.strResult = value; }
		}

		public string Error
		{
			get	{ return this.strError;  }
			set	{ this.strError = value; }
		}

		static public string[] SplitString(string str)
		{
			char[] separator = new char[] {'|'};
			return str.Split(separator);
		}
	}
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
Israel Israel


  • Nov 2010: Code Project Contests - Windows Azure Apps - Winner
  • Feb 2011: Code Project Contests - Windows Azure Apps - Grand Prize Winner



Comments and Discussions