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 Business Platform Division 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.Collections.Generic;
using System.Xml.Serialization;
using System.Runtime.Serialization;
#endregion

namespace Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.DataContracts
{
    [Serializable]
    [XmlType(TypeName = "CalculatorRequest", Namespace = "http://windowsazure.cat.microsoft.com/samples/servicebusforwindowsserver")]
    [XmlRoot(ElementName = "CalculatorRequest", Namespace = "http://windowsazure.cat.microsoft.com/samples/servicebusforwindowsserver", IsNullable = false)]
    [DataContract(Name = "CalculatorRequest", Namespace = "http://windowsazure.cat.microsoft.com/samples/servicebusforwindowsserver")]
    public class CalculatorRequest
    {
        #region Private Fields
        private OperationList operationList;
        #endregion

        #region Public Constructors
        public CalculatorRequest()
        {
            operationList = new OperationList();
        }

        public CalculatorRequest(OperationList operationList)
        {
            this.operationList = operationList;
        }
        #endregion

        #region Public Properties
        [XmlArrayItem("Operation", Type=typeof(Operation), IsNullable = false)]
        [DataMember(Order = 1)]
        public OperationList Operations
        {
            get
            {
                return operationList;
            }
            set
            {
                operationList = value;
            }
        } 
        #endregion
    }

    [CollectionDataContract(Name = "OperationList", Namespace = "http://windowsazure.cat.microsoft.com/samples/servicebusforwindowsserver", ItemName = "Operation")]
    public class OperationList : List<Operation>
    {
    }

    [Serializable]
    [XmlType(TypeName = "Operation", AnonymousType = true, Namespace = "http://windowsazure.cat.microsoft.com/samples/servicebusforwindowsserver")]
    [DataContract(Name = "Operation", Namespace = "http://windowsazure.cat.microsoft.com/samples/servicebusforwindowsserver")]
    public class Operation
    {
        #region Private Fields
        private string op;
        private double operand1;
        private double operand2;
        #endregion

        #region Public Constructors
        public Operation()
        {
        }

        public Operation(string op,
                         double operand1,
                         double operand2)
        {
            this.op = op;
            this.operand1 = operand1;
            this.operand2 = operand2;
        }
        #endregion

        #region Public Properties
        [XmlElement]
        [DataMember(Order = 1)]
        public string Operator
        {
            get
            {
                return op;
            }
            set
            {
                op = value;
            }
        }

        [XmlElement]
        [DataMember(Order = 2)]
        public double Operand1
        {
            get
            {
                return operand1;
            }
            set
            {
                operand1 = value;
            }
        }

        [XmlElement]
        [DataMember(Order = 3)]
        public double Operand2
        {
            get
            {
                return operand2;
            }
            set
            {
                operand2 = value;
            }
        } 
        #endregion
    }
}