Click here to Skip to main content
15,897,704 members
Articles / Programming Languages / C#

BizTalk Enterprise Integration Patterns - Part 1

Rate me:
Please Sign up or sign in to vote.
3.40/5 (6 votes)
25 Apr 2006CPOL3 min read 47.6K   23  
This article explains the Content Enricher pattern of Message Oriented Systems for BizTalk Server 2004.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;

namespace WSPartStore
{
	/// <summary>
	/// Summary description for Service1.
	/// </summary>
	public class Parts : System.Web.Services.WebService
	{
		public Parts()
		{
			//CODEGEN: This call is required by the ASP.NET Web Services Designer
			InitializeComponent();
		}

		#region Component Designer generated code
		
		//Required by the Web Services Designer 
		private IContainer components = null;
				
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if(disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(disposing);		
		}
		
		#endregion

		/// <summary>
		/// NOTE: This method dummies call to the database for actual data retrieval.
		/// </summary>
		/// <param name="partNo">PartNo</param>
		/// <returns>PartInfo</returns>
		[WebMethod]
		public PartInfo RetrievePartInfo(string partNo)
		{
			// TODO: Write the code to connect to the database and retrieve the part information.
			// For simplicity of the WS, hardcoded values are being returned...
			return new PartInfo(partNo, "DRAM-CHIP-304204", "moto-424542", 
								"MOTOBORA","3424-34","23-5634",
								"PAT-235253",
								"DES-2524",
								"SUP-23155");
		}
	}

	/// <summary>
	/// Holds the PartInformation
	/// </summary>
	public class PartInfo
	{
		private string partNo = string.Empty;
		private string partName = string.Empty;
		private string manufacturerId = string.Empty;
		private string manufacturerName = string.Empty;
		private string groupId = string.Empty;
		private string categoryId = string.Empty;
		private string patentNo = string.Empty;
		private string designNo = string.Empty;
		private string supplierId = string.Empty;

		/// <summary>
		/// Default constructor - PartInfo
		/// </summary>
		public PartInfo()
		{
		}

		public PartInfo(string partNo, string partName, string manufacturerId, 
			string manufacturerName, string groupId, string categoryId, 
			string patentNo, string designNo, string supplierId)
		{
			this.partNo = partNo;
			this.partName = partName;
			this.manufacturerId = manufacturerId;
			this.manufacturerName = manufacturerName;
			this.groupId = groupId;
			this.categoryId = categoryId;
			this.patentNo = patentNo;
			this.designNo = designNo;
			this.supplierId = supplierId;
		}

		public string PartNo
		{
			get 
			{
				return this.partNo;
			}
			set
			{
				this.partNo = value;
			}
		}

		public string PartName
		{
			get 
			{
				return this.partName;
			}
			set
			{
				this.partName = value;
			}
		}

		public string ManufacturerId
		{
			get 
			{
				return this.manufacturerId;
			}
			set
			{
				this.manufacturerId = value;
			}
		}

		public string ManufacturerName
		{
			get 
			{
				return this.manufacturerName;
			}
			set
			{
				this.manufacturerName = value;
			}
		}

		public string GroupId
		{
			get 
			{
				return this.groupId;
			}
			set
			{
				this.groupId = value;
			}
		}

		public string CategoryId
		{
			get 
			{
				return this.categoryId;
			}
			set
			{
				this.categoryId = value;
			}
		}

		public string PatentNo
		{
			get 
			{
				return this.patentNo;
			}
			set
			{
				this.patentNo = value;
			}
		}

		public string DesignNo
		{
			get 
			{
				return this.designNo;
			}
			set
			{
				this.designNo = value;
			}
		}

		public string SupplierId
		{
			get 
			{
				return this.supplierId;
			}
			set
			{
				this.supplierId = value;
			}
		}
	}
}

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
Architect AT&T Wi-Fi Services
United States United States
Naveen has done his Masters (M.S.) in Computer science, has started his career programming the mainframes and now has more than a decade of programming, development and design experience. Naveen has a sharp eye and keen observation skills. Naveen has worked for several companies and strived hard to build large scale business applications and bringing better solutions to the table.
Quite recently Naveen has built a fairly complex integration platform for a large bank. His hobbies include training, mentoring and research. Naveen spends his free time visiting National Parks nationwide.

Naveen has developed the BizTalk Control Center (BCC)
http://biztalkcontrolcenter.codeplex.com

Comments and Discussions