Skip to main content

How to integrate BizTalk Server 2010 / 2013 with Service Bus for Windows Server

This solution shows how to integrate a BizTalk Server 2010/2013 application with Service Bus for Windows Server using the WCF-Custom adapter to exchange messages with external systems in a reliable, flexible, and scalable manner.

C# (5.3 MB)
 
 
 
 
 
4.7 Star
(6)
1,708 times
Add to favorites
6/20/2014
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
#region Copyright
//=======================================================================================
//Microsoft Windows Server AppFabric Customer Advisory Team (CAT)  
//
// This sample is supplemental to the technical guidance published on the community
// blog at http://blogs.msdn.com/paolos. 
// 
// Author: Paolo Salvatori
//=======================================================================================
// Copyright © 2011 Microsoft Corporation. All rights reserved.
// 
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
// EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF 
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. YOU BEAR THE RISK OF USING IT.
//=======================================================================================
#endregion

#region Using Directives
using System;
using System.Configuration;
using System.ServiceModel.Configuration;
#endregion

namespace Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.ListenUri
{
    public class ListenUriBehaviorExtensionElement : BehaviorExtensionElement
    {
        #region Private Constants
        //***************************
        // Constants
        //***************************

        private const string ListenUriName = "listenUri";
        private const string IsTrackingEnabledName = "isTrackingEnabled";
        private const string ListenUriDescription = "Gets or sets the URI at which the service endpoint listens.";
        private const string IsTrackingEnabledDescription = "Gets or sets a value indicating whether tracking is enabled.";
        #endregion

        #region BehaviorExtensionElement Members
        //***************************
        // Protected Methods
        //***************************

        /// <summary>
        /// Creates a behavior extension based on the current configuration settings.
        /// </summary>
        /// <returns>The behavior extension.</returns>
        protected override object CreateBehavior()
        {
            return new ListenUriEndpointBehavior(ListenUri, IsTrackingEnabled);
        }

        /// <summary>
        /// Gets the type of behavior.
        /// </summary>
        public override Type BehaviorType
        {
            get
            {
                return typeof(ListenUriEndpointBehavior);
            }
        }      
        #endregion

        #region Public Properties
        /// <summary>
        /// Gets or sets the URI at which the service endpoint listens.
        /// </summary>
        [ConfigurationProperty(ListenUriName, IsRequired = true)]
        [SettingsDescription(ListenUriDescription)]
        public string ListenUri
        {
            get
            {
                return (string)base[ListenUriName];
            }
            set
            {
                base[ListenUriName] = value;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether the message inspector is enabled.
        /// </summary>
        [ConfigurationProperty(IsTrackingEnabledName, DefaultValue = true, IsRequired = false)]
        [SettingsDescription(IsTrackingEnabledDescription)]
        public bool IsTrackingEnabled
        {
            get
            {
                return (bool)base[IsTrackingEnabledName];
            }
            set
            {
                base[IsTrackingEnabledName] = value;
            }
        }
        #endregion
    }
}