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,705 times
Add to favorites
6/20/2014
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
#pragma warning disable 162

namespace Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations
{

    [Microsoft.XLANGs.BaseTypes.PortTypeOperationAttribute(
        "ReceiveRequest",
        new System.Type[]{
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.__messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest)
        },
        new string[]{
        }
    )]
    [Microsoft.XLANGs.BaseTypes.PortTypeAttribute(Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic, "")]
    [System.SerializableAttribute]
    sealed public class OneWayRequestPortType : Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase
    {
        public OneWayRequestPortType(int portInfo, Microsoft.XLANGs.Core.IServiceProxy s)
            : base(portInfo, s)
        { }
        public OneWayRequestPortType(OneWayRequestPortType p)
            : base(p)
        { }

        public override Microsoft.XLANGs.Core.PortBase Clone()
        {
            OneWayRequestPortType p = new OneWayRequestPortType(this);
            return p;
        }

        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic;
        #region port reflection support
        static public Microsoft.XLANGs.Core.OperationInfo ReceiveRequest = new Microsoft.XLANGs.Core.OperationInfo
        (
            "ReceiveRequest",
            System.Web.Services.Description.OperationFlow.OneWay,
            typeof(OneWayRequestPortType),
            typeof(__messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest),
            null,
            new System.Type[]{},
            new string[]{}
        );
        static public System.Collections.Hashtable OperationsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[ "ReceiveRequest" ] = ReceiveRequest;
                return h;
            }
        }
        #endregion // port reflection support
    }

    [Microsoft.XLANGs.BaseTypes.PortTypeOperationAttribute(
        "SendResponse",
        new System.Type[]{
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.__messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse)
        },
        new string[]{
        }
    )]
    [Microsoft.XLANGs.BaseTypes.PortTypeAttribute(Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic, "")]
    [System.SerializableAttribute]
    sealed public class OneWayResponsePortType : Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase
    {
        public OneWayResponsePortType(int portInfo, Microsoft.XLANGs.Core.IServiceProxy s)
            : base(portInfo, s)
        { }
        public OneWayResponsePortType(OneWayResponsePortType p)
            : base(p)
        { }

        public override Microsoft.XLANGs.Core.PortBase Clone()
        {
            OneWayResponsePortType p = new OneWayResponsePortType(this);
            return p;
        }

        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic;
        #region port reflection support
        static public Microsoft.XLANGs.Core.OperationInfo SendResponse = new Microsoft.XLANGs.Core.OperationInfo
        (
            "SendResponse",
            System.Web.Services.Description.OperationFlow.OneWay,
            typeof(OneWayResponsePortType),
            typeof(__messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse),
            null,
            new System.Type[]{},
            new string[]{}
        );
        static public System.Collections.Hashtable OperationsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[ "SendResponse" ] = SendResponse;
                return h;
            }
        }
        #endregion // port reflection support
    }

    [Microsoft.XLANGs.BaseTypes.PortTypeOperationAttribute(
        "SendResponse",
        new System.Type[]{
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.__messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse)
        },
        new string[]{
        }
    )]
    [Microsoft.XLANGs.BaseTypes.PortTypeAttribute(Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic, "")]
    [System.SerializableAttribute]
    sealed public class DynamicResponsePortType : Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase
    {
        public DynamicResponsePortType(int portInfo, Microsoft.XLANGs.Core.IServiceProxy s)
            : base(portInfo, s)
        { }
        public DynamicResponsePortType(DynamicResponsePortType p)
            : base(p)
        { }

        public override Microsoft.XLANGs.Core.PortBase Clone()
        {
            DynamicResponsePortType p = new DynamicResponsePortType(this);
            return p;
        }

        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic;
        #region port reflection support
        static public Microsoft.XLANGs.Core.OperationInfo SendResponse = new Microsoft.XLANGs.Core.OperationInfo
        (
            "SendResponse",
            System.Web.Services.Description.OperationFlow.OneWay,
            typeof(DynamicResponsePortType),
            typeof(__messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse),
            null,
            new System.Type[]{},
            new string[]{}
        );
        static public System.Collections.Hashtable OperationsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[ "SendResponse" ] = SendResponse;
                return h;
            }
        }
        #endregion // port reflection support
    }
    //#line 325 "C:\Demos\How to integrate BizTalk Server 2010  2013 with Service Bus for Windows Server\C#\Orchestrations\StaticSendPortOrchestration.odx"
    [Microsoft.XLANGs.BaseTypes.StaticSubscriptionAttribute(
        0, "OneWayRequestPort", "ReceiveRequest", 0, -1, true
    )]
    [Microsoft.XLANGs.BaseTypes.ActivationPredicateAttribute(
        0,
        new bool[] {
            true
        },
        new System.Type[] {
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Method)
        },
        new Microsoft.XLANGs.BaseTypes.EXLangPredicateOperator[] {
            Microsoft.XLANGs.BaseTypes.EXLangPredicateOperator.eOpEqual
        },
        new System.Object[] {
            "Static"
        }
    )]
    [Microsoft.XLANGs.BaseTypes.ServicePortsAttribute(
        new Microsoft.XLANGs.BaseTypes.EXLangSParameter[] {
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.ePort|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements,
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.ePort|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eUses,
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.ePort|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eUses
        },
        new System.Type[] {
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.OneWayRequestPortType),
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.OneWayResponsePortType),
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.OneWayResponsePortType)
        },
        new System.String[] {
            "OneWayRequestPort",
            "QueueResponsePort",
            "TopicResponsePort"
        },
        new System.Type[] {
            null,
            null,
            null
        }
    )]
    [Microsoft.XLANGs.BaseTypes.ServiceCallTreeAttribute(
        new System.Type[] {
        },
        new System.Type[] {
        },
        new System.Type[] {
        }
    )]
    [Microsoft.XLANGs.BaseTypes.ServiceAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal,
        Microsoft.XLANGs.BaseTypes.EXLangSServiceInfo.eNone
    )]
    [System.SerializableAttribute]
    [Microsoft.XLANGs.BaseTypes.BPELExportableAttribute(false)]
    sealed internal class StaticSendPortOrchestration : Microsoft.BizTalk.XLANGs.BTXEngine.BTXService
    {
        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal;
        public static readonly bool __execable = false;
        [Microsoft.XLANGs.BaseTypes.CallCompensationAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSCallCompensationInfo.eNone,
            new System.String[] {
            },
            new System.String[] {
            }
        )]
        public static void __bodyProxy()
        {
        }
        private static System.Guid _serviceId = Microsoft.XLANGs.Core.HashHelper.HashServiceType(typeof(StaticSendPortOrchestration));
        private static volatile System.Guid[] _activationSubIds;

        private static new object _lockIdentity = new object();

        public static System.Guid UUID { get { return _serviceId; } }
        public override System.Guid ServiceId { get { return UUID; } }

        protected override System.Guid[] ActivationSubGuids
        {
            get { return _activationSubIds; }
            set { _activationSubIds = value; }
        }

        protected override object StaleStateLock
        {
            get { return _lockIdentity; }
        }

        protected override bool HasActivation { get { return true; } }

        internal bool IsExeced = false;

        static StaticSendPortOrchestration()
        {
            Microsoft.BizTalk.XLANGs.BTXEngine.BTXService.CacheStaticState( _serviceId );
        }

        private void ConstructorHelper()
        {
            _segments = new Microsoft.XLANGs.Core.Segment[] {
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment0), 0, 0, 0),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment1), 1, 1, 1),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment2), 1, 2, 2),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment3), 1, 3, 3),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment4), 1, 3, 4),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment5), 1, 3, 5),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment6), 1, 2, 6),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment7), 1, 2, 7)
            };

            _Locks = 0;
            _rootContext = new __StaticSendPortOrchestration_root_0(this);
            _stateMgrs = new Microsoft.XLANGs.Core.IStateManager[4];
            _stateMgrs[0] = _rootContext;
            FinalConstruct();
        }

        public StaticSendPortOrchestration(System.Guid instanceId, Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession session, Microsoft.BizTalk.XLANGs.BTXEngine.BTXEvents tracker)
            : base(instanceId, session, "StaticSendPortOrchestration", tracker)
        {
            ConstructorHelper();
        }

        public StaticSendPortOrchestration(int callIndex, System.Guid instanceId, Microsoft.BizTalk.XLANGs.BTXEngine.BTXService parent)
            : base(callIndex, instanceId, parent, "StaticSendPortOrchestration")
        {
            ConstructorHelper();
        }

        private const string _symInfo = @"
<XsymFile>
<ProcessFlow xmlns:om='http://schemas.microsoft.com/BizTalk/2003/DesignerData'>      <shapeType>RootShape</shapeType>      <ShapeID>f3b37908-39f7-4b82-ac11-a67ce1d90b74</ShapeID>      
<children>                          
<ShapeInfo>      <shapeType>ReceiveShape</shapeType>      <ShapeID>1ca1c5c3-e478-45d6-b470-5676dd9fc8b8</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>Receive</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>DNFPredicateShape</shapeType>      <ShapeID>f7856040-108e-4784-bfd0-6ea777deab3e</ShapeID>      <ParentLink>Receive_DNFPredicate</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>4e1dd4be-957f-4113-8652-89a67ff1041c</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>OuterScope</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>a1261e6a-0d1a-475b-83e4-4e99f07a14b3</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>InnerScope</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>edaf6f9f-2be8-4d46-8453-59c8cad8f0b3</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>BusinessLogic</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>CatchShape</shapeType>      <ShapeID>34c27f13-679a-4708-abf4-dc49912c0117</ShapeID>      <ParentLink>Scope_Catch</ParentLink>                <shapeText>System.Exception</shapeText>                      <ExceptionType>System.Exception</ExceptionType>            
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>ba4200af-1922-46f0-8abd-e91f39be4958</ShapeID>      <ParentLink>Catch_Statement</ParentLink>                <shapeText>ManageException</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>CatchShape</shapeType>      <ShapeID>56bf2308-9805-442b-aced-4062e37f84f4</ShapeID>      <ParentLink>Scope_Catch</ParentLink>                <shapeText>General Exception</shapeText>                      <ExceptionType>General Exception</ExceptionType>            
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>c01bb104-76c2-4e48-8800-247aa9e625d0</ShapeID>      <ParentLink>Catch_Statement</ParentLink>                <shapeText>ManageException</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ConstructShape</shapeType>      <ShapeID>03ec4b03-e3e5-4f9b-b596-a494b01047bc</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>ConstructMessage</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>MessageRefShape</shapeType>      <ShapeID>836ff9dd-7aaf-41ad-9eb1-b8133662d785</ShapeID>      <ParentLink>Construct_MessageRef</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageAssignmentShape</shapeType>      <ShapeID>a3a94924-da09-458d-9cd7-4d492f11d7c3</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>MessageAssignment</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>DecisionShape</shapeType>      <ShapeID>83b8b9b5-5621-4c58-ad9a-88c3aeae1524</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>Return Response Via Queue?</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>DecisionBranchShape</shapeType>      <ShapeID>991b5e35-f244-45f9-bb08-fb7b2bad3c1d</ShapeID>      <ParentLink>ReallyComplexStatement_Branch</ParentLink>                <shapeText>Queue</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>SendShape</shapeType>      <ShapeID>9e540dea-ef6d-4e3f-acad-f77faa7196e2</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>Send</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>DecisionBranchShape</shapeType>      <ShapeID>b45f314c-8664-4ca1-a670-93849de37242</ShapeID>      <ParentLink>ReallyComplexStatement_Branch</ParentLink>                <shapeText>Topic</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>SendShape</shapeType>      <ShapeID>9d0417fd-c8b4-4537-8e11-8880b22cb7ee</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>Send_</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>CatchShape</shapeType>      <ShapeID>475d68b6-c34a-4c9a-aaa4-eb47f4344677</ShapeID>      <ParentLink>Scope_Catch</ParentLink>                <shapeText>System.Exception</shapeText>                      <ExceptionType>System.Exception</ExceptionType>            
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>e9b4e4a4-73f4-4a93-bfba-dd475db5c52e</ShapeID>      <ParentLink>Catch_Statement</ParentLink>                <shapeText>ManageException</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>CatchShape</shapeType>      <ShapeID>381aa46b-97cd-4133-ae89-ce93a34f13f3</ShapeID>      <ParentLink>Scope_Catch</ParentLink>                <shapeText>General Exception</shapeText>                      <ExceptionType>General Exception</ExceptionType>            
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>55c81532-5a39-4f5f-8d1c-8ba8624b1aea</ShapeID>      <ParentLink>Catch_Statement</ParentLink>                <shapeText>ManageException</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ProcessFlow><Metadata>

<TrkMetadata>
<ActionName>'StaticSendPortOrchestration'</ActionName><IsAtomic>0</IsAtomic><Line>325</Line><Position>14</Position><ShapeID>'e211a116-cb8b-44e7-a052-0de295aa0001'</ShapeID>
</TrkMetadata>

<TrkMetadata>
<Line>343</Line><Position>114</Position><ShapeID>'1ca1c5c3-e478-45d6-b470-5676dd9fc8b8'</ShapeID>
<Messages>
	<MsgInfo><name>requestMessage</name><part>part</part><schema>Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorRequest</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'??__scope35'</ActionName><IsAtomic>0</IsAtomic><Line>348</Line><Position>13</Position><ShapeID>'4e1dd4be-957f-4113-8652-89a67ff1041c'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'??__scope36'</ActionName><IsAtomic>0</IsAtomic><Line>353</Line><Position>21</Position><ShapeID>'a1261e6a-0d1a-475b-83e4-4e99f07a14b3'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>358</Line><Position>48</Position><ShapeID>'edaf6f9f-2be8-4d46-8453-59c8cad8f0b3'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>366</Line><Position>29</Position><ShapeID>'34c27f13-679a-4708-abf4-dc49912c0117'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>369</Line><Position>52</Position><ShapeID>'ba4200af-1922-46f0-8abd-e91f39be4958'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>374</Line><Position>29</Position><ShapeID>'56bf2308-9805-442b-aced-4062e37f84f4'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>377</Line><Position>52</Position><ShapeID>'c01bb104-76c2-4e48-8800-247aa9e625d0'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>384</Line><Position>21</Position><ShapeID>'03ec4b03-e3e5-4f9b-b596-a494b01047bc'</ShapeID>
<Messages>
	<MsgInfo><name>responseMessage</name><part>part</part><schema>Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>397</Line><Position>21</Position><ShapeID>'83b8b9b5-5621-4c58-ad9a-88c3aeae1524'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>400</Line><Position>25</Position><ShapeID>'9e540dea-ef6d-4e3f-acad-f77faa7196e2'</ShapeID>
<Messages>
	<MsgInfo><name>responseMessage</name><part>part</part><schema>Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>405</Line><Position>25</Position><ShapeID>'9d0417fd-c8b4-4537-8e11-8880b22cb7ee'</ShapeID>
<Messages>
	<MsgInfo><name>responseMessage</name><part>part</part><schema>Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>411</Line><Position>21</Position><ShapeID>'475d68b6-c34a-4c9a-aaa4-eb47f4344677'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>414</Line><Position>44</Position><ShapeID>'e9b4e4a4-73f4-4a93-bfba-dd475db5c52e'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>420</Line><Position>21</Position><ShapeID>'381aa46b-97cd-4133-ae89-ce93a34f13f3'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>423</Line><Position>44</Position><ShapeID>'55c81532-5a39-4f5f-8d1c-8ba8624b1aea'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>
</Metadata>
</XsymFile>";

        public override string odXml { get { return _symODXML; } }

        private const string _symODXML = @"
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<om:MetaModel MajorVersion='1' MinorVersion='3' Core='2b131234-7959-458d-834f-2dc0769ce683' ScheduleModel='66366196-361d-448d-976f-cab5e87496d2' xmlns:om='http://schemas.microsoft.com/BizTalk/2003/DesignerData'>
    <om:Element Type='Module' OID='6ed55bb3-6b8f-4ebe-a6d8-235a368fe130' LowerBound='1.1' HigherBound='128.1'>
        <om:Property Name='ReportToAnalyst' Value='True' />
        <om:Property Name='Name' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations' />
        <om:Property Name='Signal' Value='False' />
        <om:Element Type='ServiceDeclaration' OID='9dc77a0c-9aba-4fa7-b48d-dcabfae0e123' ParentLink='Module_ServiceDeclaration' LowerBound='18.1' HigherBound='127.1'>
            <om:Property Name='InitializedTransactionType' Value='True' />
            <om:Property Name='IsInvokable' Value='False' />
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='StaticSendPortOrchestration' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='VariableDeclaration' OID='574e8fbd-c2cd-4731-8c13-a472514f0310' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='29.1' HigherBound='30.1'>
                <om:Property Name='UseDefaultConstructor' Value='True' />
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.ResponseManager' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='responseManager' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='2dd44047-d947-4388-a713-5ee45158c5c0' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='30.1' HigherBound='31.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.IO.Stream' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='stream' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='45de58c0-18ef-4fa5-8e80-16440ae2b18e' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='31.1' HigherBound='32.1'>
                <om:Property Name='UseDefaultConstructor' Value='True' />
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.RequestManager' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='requestManager' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='78824c75-cd3e-4919-9534-8ae4aa6eb77d' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='32.1' HigherBound='33.1'>
                <om:Property Name='UseDefaultConstructor' Value='True' />
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.LogHelper' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='logHelper' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='ed4d3481-7e96-4c39-928e-a02ceed5b150' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='33.1' HigherBound='34.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.Guid' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='guid' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='906afc82-82d5-4ba4-bb1f-8b8527b4551c' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='27.1' HigherBound='28.1'>
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='responseMessage' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='369c6b07-78c1-4c6c-ae0a-404de8ce7872' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='28.1' HigherBound='29.1'>
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorRequest' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='requestMessage' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='ServiceBody' OID='f3b37908-39f7-4b82-ac11-a67ce1d90b74' ParentLink='ServiceDeclaration_ServiceBody'>
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='Receive' OID='1ca1c5c3-e478-45d6-b470-5676dd9fc8b8' ParentLink='ServiceBody_Statement' LowerBound='36.1' HigherBound='41.1'>
                    <om:Property Name='Activate' Value='True' />
                    <om:Property Name='PortName' Value='OneWayRequestPort' />
                    <om:Property Name='MessageName' Value='requestMessage' />
                    <om:Property Name='OperationName' Value='ReceiveRequest' />
                    <om:Property Name='OperationMessageName' Value='Request' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Receive' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='DNFPredicate' OID='f7856040-108e-4784-bfd0-6ea777deab3e' ParentLink='Receive_DNFPredicate'>
                        <om:Property Name='LHS' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Method' />
                        <om:Property Name='RHS' Value='&quot;Static&quot;' />
                        <om:Property Name='Grouping' Value='AND' />
                        <om:Property Name='Operator' Value='Equals' />
                        <om:Property Name='Signal' Value='False' />
                    </om:Element>
                </om:Element>
                <om:Element Type='Scope' OID='4e1dd4be-957f-4113-8652-89a67ff1041c' ParentLink='ServiceBody_Statement' LowerBound='41.1' HigherBound='125.1'>
                    <om:Property Name='InitializedTransactionType' Value='True' />
                    <om:Property Name='IsSynchronized' Value='False' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='OuterScope' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='Scope' OID='a1261e6a-0d1a-475b-83e4-4e99f07a14b3' ParentLink='ComplexStatement_Statement' LowerBound='46.1' HigherBound='77.1'>
                        <om:Property Name='InitializedTransactionType' Value='True' />
                        <om:Property Name='IsSynchronized' Value='False' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='InnerScope' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='VariableAssignment' OID='edaf6f9f-2be8-4d46-8453-59c8cad8f0b3' ParentLink='ComplexStatement_Statement' LowerBound='51.1' HigherBound='56.1'>
                            <om:Property Name='Expression' Value='logHelper.WriteLine(&quot;[StaticSendPortOrchestration] Request message received from [{0}].&quot;, &#xD;&#xA;                    requestMessage(WCF.To));&#xD;&#xA;stream = requestManager.ProcessRequestReturnStream(requestMessage);&#xD;&#xA;logHelper.WriteLine(&quot;[StaticSendPortOrchestration] Request message successfully processed.&quot;);&#xD;&#xA;' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='BusinessLogic' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                        <om:Element Type='Catch' OID='34c27f13-679a-4708-abf4-dc49912c0117' ParentLink='Scope_Catch' LowerBound='59.1' HigherBound='67.1'>
                            <om:Property Name='ExceptionName' Value='ex' />
                            <om:Property Name='ExceptionType' Value='System.Exception' />
                            <om:Property Name='IsFaultMessage' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='System.Exception' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='VariableAssignment' OID='ba4200af-1922-46f0-8abd-e91f39be4958' ParentLink='Catch_Statement' LowerBound='62.1' HigherBound='66.1'>
                                <om:Property Name='Expression' Value='logHelper.WriteLine(&quot;[StaticSendPortOrchestration] Creating error response...&quot;);&#xD;&#xA;stream = logHelper.GenerateErrorStream(ex);&#xD;&#xA;logHelper.WriteLine(System.String.Format(&quot;[StaticSendPortOrchestration] {0}&quot;, ex.Message));&#xD;&#xA;' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='ManageException' />
                                <om:Property Name='Signal' Value='False' />
                            </om:Element>
                        </om:Element>
                        <om:Element Type='Catch' OID='56bf2308-9805-442b-aced-4062e37f84f4' ParentLink='Scope_Catch' LowerBound='67.1' HigherBound='75.1'>
                            <om:Property Name='ExceptionType' Value='General Exception' />
                            <om:Property Name='IsFaultMessage' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='General Exception' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='VariableAssignment' OID='c01bb104-76c2-4e48-8800-247aa9e625d0' ParentLink='Catch_Statement' LowerBound='70.1' HigherBound='74.1'>
                                <om:Property Name='Expression' Value='logHelper.WriteLine(&quot;[StaticSendPortOrchestration] Creating error response...&quot;);&#xD;&#xA;stream = logHelper.GenerateErrorStream(&quot;General Exception.&quot;);&#xD;&#xA;logHelper.WriteLine(&quot;[StaticSendPortOrchestration] General Exception.&quot;);' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='ManageException' />
                                <om:Property Name='Signal' Value='False' />
                            </om:Element>
                        </om:Element>
                    </om:Element>
                    <om:Element Type='Construct' OID='03ec4b03-e3e5-4f9b-b596-a494b01047bc' ParentLink='ComplexStatement_Statement' LowerBound='77.1' HigherBound='90.1'>
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='ConstructMessage' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='MessageRef' OID='836ff9dd-7aaf-41ad-9eb1-b8133662d785' ParentLink='Construct_MessageRef' LowerBound='78.31' HigherBound='78.46'>
                            <om:Property Name='Ref' Value='responseMessage' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                        <om:Element Type='MessageAssignment' OID='a3a94924-da09-458d-9cd7-4d492f11d7c3' ParentLink='ComplexStatement_Statement' LowerBound='80.1' HigherBound='89.1'>
                            <om:Property Name='Expression' Value='responseMessage = null;&#xD;&#xA;responseManager.SetResponse(responseMessage, stream);&#xD;&#xA;responseMessage(*) = requestMessage(*);&#xD;&#xA;guid = System.Guid.NewGuid();&#xD;&#xA;responseMessage(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Application) = &quot;ServiceBusSample&quot;;&#xD;&#xA;responseMessage(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.MessageId) = guid.ToString();&#xD;&#xA;responseMessage(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.CorrelationId) = responseManager.GetMessageId(requestMessage);&#xD;&#xA;responseMessage(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.SessionId) = responseManager.GetReplyToSessionId(requestMessage);' />
                            <om:Property Name='ReportToAnalyst' Value='False' />
                            <om:Property Name='Name' Value='MessageAssignment' />
                            <om:Property Name='Signal' Value='True' />
                        </om:Element>
                    </om:Element>
                    <om:Element Type='Decision' OID='83b8b9b5-5621-4c58-ad9a-88c3aeae1524' ParentLink='ComplexStatement_Statement' LowerBound='90.1' HigherBound='101.1'>
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='Return Response Via Queue?' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='DecisionBranch' OID='991b5e35-f244-45f9-bb08-fb7b2bad3c1d' ParentLink='ReallyComplexStatement_Branch' LowerBound='91.21' HigherBound='96.1'>
                            <om:Property Name='Expression' Value='requestManager.ReturnResponseViaQueue(requestMessage)' />
                            <om:Property Name='IsGhostBranch' Value='True' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='Queue' />
                            <om:Property Name='Signal' Value='False' />
                            <om:Element Type='Send' OID='9e540dea-ef6d-4e3f-acad-f77faa7196e2' ParentLink='ComplexStatement_Statement' LowerBound='93.1' HigherBound='95.1'>
                                <om:Property Name='PortName' Value='QueueResponsePort' />
                                <om:Property Name='MessageName' Value='responseMessage' />
                                <om:Property Name='OperationName' Value='SendResponse' />
                                <om:Property Name='OperationMessageName' Value='Response' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='Send' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                        </om:Element>
                        <om:Element Type='DecisionBranch' OID='b45f314c-8664-4ca1-a670-93849de37242' ParentLink='ReallyComplexStatement_Branch'>
                            <om:Property Name='IsGhostBranch' Value='True' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='Topic' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='Send' OID='9d0417fd-c8b4-4537-8e11-8880b22cb7ee' ParentLink='ComplexStatement_Statement' LowerBound='98.1' HigherBound='100.1'>
                                <om:Property Name='PortName' Value='TopicResponsePort' />
                                <om:Property Name='MessageName' Value='responseMessage' />
                                <om:Property Name='OperationName' Value='SendResponse' />
                                <om:Property Name='OperationMessageName' Value='Response' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='Send_' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                        </om:Element>
                    </om:Element>
                    <om:Element Type='Catch' OID='475d68b6-c34a-4c9a-aaa4-eb47f4344677' ParentLink='Scope_Catch' LowerBound='104.1' HigherBound='113.1'>
                        <om:Property Name='ExceptionName' Value='ex' />
                        <om:Property Name='ExceptionType' Value='System.Exception' />
                        <om:Property Name='IsFaultMessage' Value='False' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='System.Exception' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='VariableAssignment' OID='e9b4e4a4-73f4-4a93-bfba-dd475db5c52e' ParentLink='Catch_Statement' LowerBound='107.1' HigherBound='112.1'>
                            <om:Property Name='Expression' Value='logHelper.WriteLine(System.String.Format(&quot;[StaticSendPortOrchestration] {0}&quot;, ex.Message));&#xD;&#xA;System.Diagnostics.EventLog.WriteEntry(&quot;StaticSendPortOrchestration&quot;, &#xD;&#xA;                                       ex.Message, &#xD;&#xA;                                       System.Diagnostics.EventLogEntryType.Error);' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='ManageException' />
                            <om:Property Name='Signal' Value='True' />
                        </om:Element>
                    </om:Element>
                    <om:Element Type='Catch' OID='381aa46b-97cd-4133-ae89-ce93a34f13f3' ParentLink='Scope_Catch' LowerBound='113.1' HigherBound='123.1'>
                        <om:Property Name='ExceptionType' Value='General Exception' />
                        <om:Property Name='IsFaultMessage' Value='False' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='General Exception' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='VariableAssignment' OID='55c81532-5a39-4f5f-8d1c-8ba8624b1aea' ParentLink='Catch_Statement' LowerBound='116.1' HigherBound='122.1'>
                            <om:Property Name='Expression' Value='logHelper.WriteLine(&quot;[StaticSendPortOrchestration] General Exception.&quot;);&#xD;&#xA;System.Diagnostics.EventLog.WriteEntry(&quot;StaticSendPortOrchestration&quot;, &#xD;&#xA;                                       &quot;General Exception.&quot;, &#xD;&#xA;                                       System.Diagnostics.EventLogEntryType.Error);&#xD;&#xA;&#xD;&#xA;' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='ManageException' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                    </om:Element>
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='d4eed45f-544d-48bb-a1c9-d6afe048748e' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='21.1' HigherBound='23.1'>
                <om:Property Name='PortModifier' Value='Uses' />
                <om:Property Name='Orientation' Value='Left' />
                <om:Property Name='PortIndex' Value='56' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.OneWayResponsePortType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='QueueResponsePort' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='LogicalBindingAttribute' OID='a861f18b-3245-447a-92a7-1ef214be0783' ParentLink='PortDeclaration_CLRAttribute' LowerBound='21.1' HigherBound='22.1'>
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='199cffe5-e150-4623-9649-3f3e767a231e' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='23.1' HigherBound='25.1'>
                <om:Property Name='PortModifier' Value='Implements' />
                <om:Property Name='Orientation' Value='Left' />
                <om:Property Name='PortIndex' Value='1' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.OneWayRequestPortType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='OneWayRequestPort' />
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='DirectBindingAttribute' OID='0810ebec-48e5-443d-a3d1-a86c895ec76e' ParentLink='PortDeclaration_CLRAttribute' LowerBound='23.1' HigherBound='24.1'>
                    <om:Property Name='DirectBindingType' Value='MessageBox' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='cc36290a-915b-495c-8097-1c35db6273be' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='25.1' HigherBound='27.1'>
                <om:Property Name='PortModifier' Value='Uses' />
                <om:Property Name='Orientation' Value='Right' />
                <om:Property Name='PortIndex' Value='62' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.OneWayResponsePortType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='TopicResponsePort' />
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='LogicalBindingAttribute' OID='c72b4b1b-d71b-4840-bb69-476903464a74' ParentLink='PortDeclaration_CLRAttribute' LowerBound='25.1' HigherBound='26.1'>
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
        </om:Element>
        <om:Element Type='PortType' OID='08782e09-3881-46ba-ac86-edd6e1eb0600' ParentLink='Module_PortType' LowerBound='4.1' HigherBound='11.1'>
            <om:Property Name='Synchronous' Value='False' />
            <om:Property Name='TypeModifier' Value='Public' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='OneWayRequestPortType' />
            <om:Property Name='Signal' Value='False' />
            <om:Element Type='OperationDeclaration' OID='07c48023-e6dd-4997-a258-078c35c68135' ParentLink='PortType_OperationDeclaration' LowerBound='6.1' HigherBound='10.1'>
                <om:Property Name='OperationType' Value='OneWay' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='ReceiveRequest' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='MessageRef' OID='86c308ce-cb9b-41a2-a89b-c2ed6670f510' ParentLink='OperationDeclaration_RequestMessageRef' LowerBound='8.13' HigherBound='8.100'>
                    <om:Property Name='Ref' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorRequest' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Request' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
            </om:Element>
        </om:Element>
        <om:Element Type='PortType' OID='b8be6cd7-566e-4c27-9a36-202301b3be38' ParentLink='Module_PortType' LowerBound='11.1' HigherBound='18.1'>
            <om:Property Name='Synchronous' Value='False' />
            <om:Property Name='TypeModifier' Value='Public' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='OneWayResponsePortType' />
            <om:Property Name='Signal' Value='False' />
            <om:Element Type='OperationDeclaration' OID='d736209c-9aaa-4a64-89fc-c687ae8300aa' ParentLink='PortType_OperationDeclaration' LowerBound='13.1' HigherBound='17.1'>
                <om:Property Name='OperationType' Value='OneWay' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='SendResponse' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='MessageRef' OID='b7635c76-0633-4434-b421-2aa6ea7a00d3' ParentLink='OperationDeclaration_RequestMessageRef' LowerBound='15.13' HigherBound='15.101'>
                    <om:Property Name='Ref' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Response' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
            </om:Element>
        </om:Element>
    </om:Element>
</om:MetaModel>
";

        [System.SerializableAttribute]
        public class __StaticSendPortOrchestration_root_0 : Microsoft.XLANGs.Core.ServiceContext
        {
            public __StaticSendPortOrchestration_root_0(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "StaticSendPortOrchestration")
            {
            }

            public override int Index { get { return 0; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[0]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[0]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                StaticSendPortOrchestration __svc__ = (StaticSendPortOrchestration)_service;
                __StaticSendPortOrchestration_root_0 __ctx0__ = (__StaticSendPortOrchestration_root_0)(__svc__._stateMgrs[0]);

                if (__svc__.TopicResponsePort != null)
                {
                    __svc__.TopicResponsePort.Close(this, null);
                    __svc__.TopicResponsePort = null;
                }
                if (__svc__.QueueResponsePort != null)
                {
                    __svc__.QueueResponsePort.Close(this, null);
                    __svc__.QueueResponsePort = null;
                }
                if (__svc__.OneWayRequestPort != null)
                {
                    __svc__.OneWayRequestPort.Close(this, null);
                    __svc__.OneWayRequestPort = null;
                }
                base.Finally();
            }

            internal Microsoft.XLANGs.Core.SubscriptionWrapper __subWrapper0;
        }


        [System.SerializableAttribute]
        public class __StaticSendPortOrchestration_1 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public __StaticSendPortOrchestration_1(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "StaticSendPortOrchestration")
            {
            }

            public override int Index { get { return 1; } }

            public override bool CombineParentCommit { get { return true; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[1]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[1]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                StaticSendPortOrchestration __svc__ = (StaticSendPortOrchestration)_service;
                __StaticSendPortOrchestration_1 __ctx1__ = (__StaticSendPortOrchestration_1)(__svc__._stateMgrs[1]);

                if (__ctx1__ != null)
                    __ctx1__.__requestManager = null;
                if (__ctx1__ != null)
                    __ctx1__.__logHelper = null;
                if (__ctx1__ != null && __ctx1__.__requestMessage != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__requestMessage);
                    __ctx1__.__requestMessage = null;
                }
                if (__ctx1__ != null)
                    __ctx1__.__responseManager = null;
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("responseMessage")]
            public __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse __responseMessage;
            [Microsoft.XLANGs.Core.UserVariableAttribute("requestMessage")]
            public __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest __requestMessage;
            [Microsoft.XLANGs.Core.UserVariableAttribute("responseManager")]
            internal Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.ResponseManager __responseManager;
            [Microsoft.XLANGs.Core.UserVariableAttribute("stream")]
            internal System.IO.Stream __stream;
            [Microsoft.XLANGs.Core.UserVariableAttribute("requestManager")]
            internal Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.RequestManager __requestManager;
            [Microsoft.XLANGs.Core.UserVariableAttribute("logHelper")]
            internal Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.LogHelper __logHelper;
            [Microsoft.XLANGs.Core.UserVariableAttribute("guid")]
            internal System.Guid __guid;
        }


        [System.SerializableAttribute]
        public class ____scope35_2 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public ____scope35_2(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "??__scope35")
            {
            }

            public override int Index { get { return 2; } }

            public override bool CombineParentCommit { get { return true; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[2]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[2]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Microsoft.XLANGs.Core.Segment __seg__;
                Microsoft.XLANGs.Core.FaultReceiveException __fault__;

                __exv__ = _exception;
                if (!(__exv__ is Microsoft.XLANGs.Core.UnknownException))
                {
                    __fault__ = __exv__ as Microsoft.XLANGs.Core.FaultReceiveException;
                    if ((__fault__ == null) && (__exv__ is System.Exception))
                    {
                        __seg__ = _service._segments[6];
                        __seg__.Reset(1);
                        __seg__.PredecessorDone(_service);
                        return true;
                    }
                }

                __seg__ = _service._segments[7];
                __seg__.Reset(1);
                __seg__.PredecessorDone(_service);
                return true;
            }

            public override void Finally()
            {
                StaticSendPortOrchestration __svc__ = (StaticSendPortOrchestration)_service;
                __StaticSendPortOrchestration_1 __ctx1__ = (__StaticSendPortOrchestration_1)(__svc__._stateMgrs[1]);
                ____scope35_2 __ctx2__ = (____scope35_2)(__svc__._stateMgrs[2]);

                if (__ctx1__ != null && __ctx1__.__responseMessage != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__responseMessage);
                    __ctx1__.__responseMessage = null;
                }
                if (__ctx1__ != null)
                    __ctx1__.__stream = null;
                if (__ctx2__ != null)
                    __ctx2__.__ex_0 = null;
                base.Finally();
            }

            internal object __exv__;
            internal System.Exception __ex_0
            {
                get { return (System.Exception)__exv__; }
                set { __exv__ = value; }
            }
        }


        [System.SerializableAttribute]
        public class ____scope36_3 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public ____scope36_3(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "??__scope36")
            {
            }

            public override int Index { get { return 3; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[3]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[3]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Microsoft.XLANGs.Core.Segment __seg__;
                Microsoft.XLANGs.Core.FaultReceiveException __fault__;

                __exv__ = _exception;
                if (!(__exv__ is Microsoft.XLANGs.Core.UnknownException))
                {
                    __fault__ = __exv__ as Microsoft.XLANGs.Core.FaultReceiveException;
                    if ((__fault__ == null) && (__exv__ is System.Exception))
                    {
                        __seg__ = _service._segments[4];
                        __seg__.Reset(1);
                        __seg__.PredecessorDone(_service);
                        return true;
                    }
                }

                __seg__ = _service._segments[5];
                __seg__.Reset(1);
                __seg__.PredecessorDone(_service);
                return true;
            }

            public override void Finally()
            {
                StaticSendPortOrchestration __svc__ = (StaticSendPortOrchestration)_service;
                ____scope36_3 __ctx3__ = (____scope36_3)(__svc__._stateMgrs[3]);

                if (__ctx3__ != null)
                    __ctx3__.__ex_0 = null;
                base.Finally();
            }

            internal object __exv__;
            internal System.Exception __ex_0
            {
                get { return (System.Exception)__exv__; }
                set { __exv__ = value; }
            }
        }

        private static Microsoft.XLANGs.Core.CorrelationType[] _correlationTypes = null;
        public override Microsoft.XLANGs.Core.CorrelationType[] CorrelationTypes { get { return _correlationTypes; } }

        private static System.Guid[] _convoySetIds;

        public override System.Guid[] ConvoySetGuids
        {
            get { return _convoySetIds; }
            set { _convoySetIds = value; }
        }

        public static object[] StaticConvoySetInformation
        {
            get {
                return null;
            }
        }

        [Microsoft.XLANGs.BaseTypes.DirectBindingAttribute()]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("OneWayRequestPort")]
        internal OneWayRequestPortType OneWayRequestPort;
        [Microsoft.XLANGs.BaseTypes.LogicalBindingAttribute()]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eUses
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("QueueResponsePort")]
        internal OneWayResponsePortType QueueResponsePort;
        [Microsoft.XLANGs.BaseTypes.LogicalBindingAttribute()]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eUses
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("TopicResponsePort")]
        internal OneWayResponsePortType TopicResponsePort;
        private static Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Method _prop_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_Method = new Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Method();

        sealed private class PredicateSet0_0 : Microsoft.XLANGs.Core.PredicateGroup
        {
            public PredicateSet0_0() : base(1)
            {
                Add(new Microsoft.XLANGs.Core.FullySpecifiedPredicate(_prop_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_Method, Microsoft.XLANGs.Core.PredicateBase.Operators.eEqual, "Static"));
            }
        }


        private static Microsoft.XLANGs.Core.PredicateGroup[] _predicates0 = {
            new PredicateSet0_0()
        };


        public static Microsoft.XLANGs.Core.PortInfo[] _portInfo = new Microsoft.XLANGs.Core.PortInfo[] {
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {OneWayRequestPortType.ReceiveRequest},
                                               typeof(StaticSendPortOrchestration).GetField("OneWayRequestPort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.implements,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(StaticSendPortOrchestration), "OneWayRequestPort"),
                                               null),
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {OneWayResponsePortType.SendResponse},
                                               typeof(StaticSendPortOrchestration).GetField("QueueResponsePort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.uses,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(StaticSendPortOrchestration), "QueueResponsePort"),
                                               null),
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {OneWayResponsePortType.SendResponse},
                                               typeof(StaticSendPortOrchestration).GetField("TopicResponsePort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.uses,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(StaticSendPortOrchestration), "TopicResponsePort"),
                                               null)
        };

        public override Microsoft.XLANGs.Core.PortInfo[] PortInformation
        {
            get { return _portInfo; }
        }

        static public System.Collections.Hashtable PortsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[_portInfo[0].Name] = _portInfo[0];
                h[_portInfo[1].Name] = _portInfo[1];
                h[_portInfo[2].Name] = _portInfo[2];
                return h;
            }
        }

        public static System.Type[] InvokedServicesTypes
        {
            get
            {
                return new System.Type[] {
                    // type of each service invoked by this service
                };
            }
        }

        public static System.Type[] CalledServicesTypes
        {
            get
            {
                return new System.Type[] {
                };
            }
        }

        public static System.Type[] ExecedServicesTypes
        {
            get
            {
                return new System.Type[] {
                };
            }
        }

        public static object[] StaticSubscriptionsInformation {
            get {
                return new object[1]{
                     new object[5] { _portInfo[0], 0, _predicates0 , -1, true }
                };
            }
        }

        public static Microsoft.XLANGs.RuntimeTypes.Location[] __eventLocations = new Microsoft.XLANGs.RuntimeTypes.Location[] {
            new Microsoft.XLANGs.RuntimeTypes.Location(0, "00000000-0000-0000-0000-000000000000", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(1, "1ca1c5c3-e478-45d6-b470-5676dd9fc8b8", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(2, "1ca1c5c3-e478-45d6-b470-5676dd9fc8b8", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(3, "00000000-0000-0000-0000-000000000000", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(4, "4e1dd4be-957f-4113-8652-89a67ff1041c", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(5, "00000000-0000-0000-0000-000000000000", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(6, "a1261e6a-0d1a-475b-83e4-4e99f07a14b3", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(7, "00000000-0000-0000-0000-000000000000", 3, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(8, "edaf6f9f-2be8-4d46-8453-59c8cad8f0b3", 3, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(9, "edaf6f9f-2be8-4d46-8453-59c8cad8f0b3", 3, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(10, "00000000-0000-0000-0000-000000000000", 3, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(11, "34c27f13-679a-4708-abf4-dc49912c0117", 4, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(12, "ba4200af-1922-46f0-8abd-e91f39be4958", 4, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(13, "ba4200af-1922-46f0-8abd-e91f39be4958", 4, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(14, "00000000-0000-0000-0000-000000000000", 4, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(15, "00000000-0000-0000-0000-000000000000", 4, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(16, "34c27f13-679a-4708-abf4-dc49912c0117", 4, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(17, "56bf2308-9805-442b-aced-4062e37f84f4", 5, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(18, "c01bb104-76c2-4e48-8800-247aa9e625d0", 5, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(19, "c01bb104-76c2-4e48-8800-247aa9e625d0", 5, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(20, "00000000-0000-0000-0000-000000000000", 5, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(21, "00000000-0000-0000-0000-000000000000", 5, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(22, "56bf2308-9805-442b-aced-4062e37f84f4", 5, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(23, "a1261e6a-0d1a-475b-83e4-4e99f07a14b3", 2, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(24, "03ec4b03-e3e5-4f9b-b596-a494b01047bc", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(25, "03ec4b03-e3e5-4f9b-b596-a494b01047bc", 2, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(26, "83b8b9b5-5621-4c58-ad9a-88c3aeae1524", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(27, "9e540dea-ef6d-4e3f-acad-f77faa7196e2", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(28, "9e540dea-ef6d-4e3f-acad-f77faa7196e2", 2, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(29, "9d0417fd-c8b4-4537-8e11-8880b22cb7ee", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(30, "9d0417fd-c8b4-4537-8e11-8880b22cb7ee", 2, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(31, "83b8b9b5-5621-4c58-ad9a-88c3aeae1524", 2, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(32, "475d68b6-c34a-4c9a-aaa4-eb47f4344677", 6, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(33, "e9b4e4a4-73f4-4a93-bfba-dd475db5c52e", 6, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(34, "e9b4e4a4-73f4-4a93-bfba-dd475db5c52e", 6, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(35, "00000000-0000-0000-0000-000000000000", 6, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(36, "00000000-0000-0000-0000-000000000000", 6, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(37, "475d68b6-c34a-4c9a-aaa4-eb47f4344677", 6, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(38, "381aa46b-97cd-4133-ae89-ce93a34f13f3", 7, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(39, "55c81532-5a39-4f5f-8d1c-8ba8624b1aea", 7, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(40, "55c81532-5a39-4f5f-8d1c-8ba8624b1aea", 7, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(41, "00000000-0000-0000-0000-000000000000", 7, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(42, "00000000-0000-0000-0000-000000000000", 7, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(43, "381aa46b-97cd-4133-ae89-ce93a34f13f3", 7, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(44, "4e1dd4be-957f-4113-8652-89a67ff1041c", 1, false)
        };

        public override Microsoft.XLANGs.RuntimeTypes.Location[] EventLocations
        {
            get { return __eventLocations; }
        }

        public static Microsoft.XLANGs.RuntimeTypes.EventData[] __eventData = new Microsoft.XLANGs.RuntimeTypes.EventData[] {
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Body),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Receive),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Scope),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Expression),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Expression),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Catch),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Catch),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Scope),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Construct),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.If),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Send),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.If),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Body)
        };

        public static int[] __progressLocation0 = new int[] { 0,0,0,3,3,};
        public static int[] __progressLocation1 = new int[] { 0,0,1,1,2,2,2,2,4,4,4,44,3,3,3,3,};
        public static int[] __progressLocation2 = new int[] { 6,6,6,6,23,24,24,25,26,26,27,27,27,28,26,29,29,29,30,31,31,31,31,};
        public static int[] __progressLocation3 = new int[] { 8,8,8,9,9,9,9,9,9,};
        public static int[] __progressLocation4 = new int[] { 11,11,12,12,13,13,13,16,16,};
        public static int[] __progressLocation5 = new int[] { 17,17,18,18,19,19,19,22,22,};
        public static int[] __progressLocation6 = new int[] { 32,32,33,33,34,34,37,37,};
        public static int[] __progressLocation7 = new int[] { 38,38,39,39,40,40,43,43,};

        public static int[][] __progressLocations = new int[8] [] {__progressLocation0,__progressLocation1,__progressLocation2,__progressLocation3,__progressLocation4,__progressLocation5,__progressLocation6,__progressLocation7};
        public override int[][] ProgressLocations {get {return __progressLocations;} }

        public Microsoft.XLANGs.Core.StopConditions segment0(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[0];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[0];
            __StaticSendPortOrchestration_1 __ctx1__ = (__StaticSendPortOrchestration_1)_stateMgrs[1];
            __StaticSendPortOrchestration_root_0 __ctx0__ = (__StaticSendPortOrchestration_root_0)_stateMgrs[0];

            switch (__seg__.Progress)
            {
            case 0:
                QueueResponsePort = new OneWayResponsePortType(1, this);
                OneWayRequestPort = new OneWayRequestPortType(0, this);
                TopicResponsePort = new OneWayResponsePortType(2, this);
                __ctx__.PrologueCompleted = true;
                __ctx0__.__subWrapper0 = new Microsoft.XLANGs.Core.SubscriptionWrapper(ActivationSubGuids[0], OneWayRequestPort, this);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.Initialized) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.Initialized;
                goto case 1;
            case 1:
                __ctx1__ = new __StaticSendPortOrchestration_1(this);
                _stateMgrs[1] = __ctx1__;
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                __ctx0__.StartContext(__seg__, __ctx1__);
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 3:
                if (!__ctx0__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                __ctx1__.Finally();
                ServiceDone(__seg__, (Microsoft.XLANGs.Core.Context)_stateMgrs[0]);
                __ctx0__.OnCommit();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Envelope __msgEnv__ = null;
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[1];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[1];
            __StaticSendPortOrchestration_1 __ctx1__ = (__StaticSendPortOrchestration_1)_stateMgrs[1];
            ____scope35_2 __ctx2__ = (____scope35_2)_stateMgrs[2];
            __StaticSendPortOrchestration_root_0 __ctx0__ = (__StaticSendPortOrchestration_root_0)_stateMgrs[0];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx1__.__responseManager = default(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.ResponseManager);
                __ctx1__.__stream = default(System.IO.Stream);
                __ctx1__.__requestManager = default(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.RequestManager);
                __ctx1__.__logHelper = default(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.LogHelper);
                __ctx1__.__guid = default(System.Guid);
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[0],__eventData[0],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[1],__eventData[1],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                if (!OneWayRequestPort.GetMessageId(__ctx0__.__subWrapper0.getSubscription(this), __seg__, __ctx1__, out __msgEnv__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if (__ctx1__.__requestMessage != null)
                    __ctx1__.UnrefMessage(__ctx1__.__requestMessage);
                __ctx1__.__requestMessage = new __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest("requestMessage", __ctx1__);
                __ctx1__.RefMessage(__ctx1__.__requestMessage);
                OneWayRequestPort.ReceiveMessage(0, __msgEnv__, __ctx1__.__requestMessage, null, (Microsoft.XLANGs.Core.Context)_stateMgrs[1], __seg__);
                if (OneWayRequestPort != null)
                {
                    OneWayRequestPort.Close(__ctx1__, __seg__);
                    OneWayRequestPort = null;
                }
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Receive);
                    __edata.Messages.Add(__ctx1__.__requestMessage);
                    __edata.PortName = @"OneWayRequestPort";
                    Tracker.FireEvent(__eventLocations[2],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx1__.__responseManager = new Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.ResponseManager();
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                __ctx1__.__requestManager = new Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.RequestManager();
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                __ctx1__.__logHelper = new Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.LogHelper();
                if ( !PostProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 8;
            case 8:
                if ( !PreProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[4],__eventData[2],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 9;
            case 9:
                __ctx2__ = new ____scope35_2(this);
                _stateMgrs[2] = __ctx2__;
                if ( !PostProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 10;
            case 10:
                __ctx1__.StartContext(__seg__, __ctx2__);
                if ( !PostProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 11:
                if ( !PreProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                if (__ctx1__ != null)
                    __ctx1__.__logHelper = null;
                if (__ctx1__ != null)
                    __ctx1__.__requestManager = null;
                if (__ctx1__ != null)
                    __ctx1__.__responseManager = null;
                if (__ctx1__ != null && __ctx1__.__requestMessage != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__requestMessage);
                    __ctx1__.__requestMessage = null;
                }
                if (TopicResponsePort != null)
                {
                    TopicResponsePort.Close(__ctx1__, __seg__);
                    TopicResponsePort = null;
                }
                if (QueueResponsePort != null)
                {
                    QueueResponsePort.Close(__ctx1__, __seg__);
                    QueueResponsePort = null;
                }
                Tracker.FireEvent(__eventLocations[44],__eventData[7],_stateMgrs[1].TrackDataStream );
                __ctx2__.Finally();
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 12;
            case 12:
                if ( !PreProgressInc( __seg__, __ctx__, 13 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[3],__eventData[12],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 13;
            case 13:
                if (!__ctx1__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 14 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 14;
            case 14:
                if ( !PreProgressInc( __seg__, __ctx__, 15 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx1__.OnCommit();
                goto case 15;
            case 15:
                __seg__.SegmentDone();
                _segments[0].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment2(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            bool __condition__;
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[2];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[2];
            ____scope36_3 __ctx3__ = (____scope36_3)_stateMgrs[3];
            __StaticSendPortOrchestration_1 __ctx1__ = (__StaticSendPortOrchestration_1)_stateMgrs[1];
            ____scope35_2 __ctx2__ = (____scope35_2)_stateMgrs[2];
            __StaticSendPortOrchestration_root_0 __ctx0__ = (__StaticSendPortOrchestration_root_0)_stateMgrs[0];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[6],__eventData[2],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                __ctx3__ = new ____scope36_3(this);
                _stateMgrs[3] = __ctx3__;
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 3;
            case 3:
                __ctx2__.StartContext(__seg__, __ctx3__);
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[23],__eventData[7],_stateMgrs[2].TrackDataStream );
                __ctx3__.Finally();
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                if ( !PreProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[24],__eventData[8],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 6;
            case 6:
                {
                    __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse __responseMessage = new __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse("responseMessage", __ctx1__);

                    __responseMessage.part.LoadFrom(null);
                    __ctx1__.__responseManager.SetResponse(CreateMessageWrapperForUserCode(__responseMessage), __ctx1__.__stream);
                    if (__ctx1__ != null)
                        __ctx1__.__stream = null;
                    __responseMessage.CopyContextPropertiesFrom(__ctx1__.__requestMessage);
                    __ctx1__.__guid = System.Guid.NewGuid();
                    __responseMessage.SetPropertyValue(typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Application), "ServiceBusSample");
                    __responseMessage.SetPropertyValue(typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.MessageId), __ctx1__.__guid.ToString());
                    __responseMessage.SetPropertyValue(typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.CorrelationId), __ctx1__.__responseManager.GetMessageId(CreateMessageWrapperForUserCode(__ctx1__.__requestMessage)));
                    __responseMessage.SetPropertyValue(typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.SessionId), __ctx1__.__responseManager.GetReplyToSessionId(CreateMessageWrapperForUserCode(__ctx1__.__requestMessage)));

                    if (__ctx1__.__responseMessage != null)
                        __ctx1__.UnrefMessage(__ctx1__.__responseMessage);
                    __ctx1__.__responseMessage = __responseMessage;
                    __ctx1__.RefMessage(__ctx1__.__responseMessage);
                }
                __ctx1__.__responseMessage.ConstructionCompleteEvent(true);
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Construct);
                    __edata.Messages.Add(__ctx1__.__responseMessage);
                    Tracker.FireEvent(__eventLocations[25],__edata,_stateMgrs[2].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                if ( !PreProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[26],__eventData[9],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 9;
            case 9:
                __condition__ = __ctx1__.__requestManager.ReturnResponseViaQueue(CreateMessageWrapperForUserCode(__ctx1__.__requestMessage));
                if (!__condition__)
                {
                    if ( !PostProgressInc( __seg__, __ctx__, 15 ) )
                        return Microsoft.XLANGs.Core.StopConditions.Paused;
                    goto case 15;
                }
                if ( !PostProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 10;
            case 10:
                if ( !PreProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[27],__eventData[10],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 11;
            case 11:
                if (!__ctx2__.PrepareToPendingCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 12;
            case 12:
                if ( !PreProgressInc( __seg__, __ctx__, 13 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                QueueResponsePort.SendMessage(0, __ctx1__.__responseMessage, null, null, __ctx2__, __seg__ , Microsoft.XLANGs.Core.ActivityFlags.NextActivityPersists );
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.OutgoingRqst) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.OutgoingRqst;
                goto case 13;
            case 13:
                if ( !PreProgressInc( __seg__, __ctx__, 14 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Send);
                    __edata.Messages.Add(__ctx1__.__responseMessage);
                    __edata.PortName = @"QueueResponsePort";
                    Tracker.FireEvent(__eventLocations[28],__edata,_stateMgrs[2].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 14;
            case 14:
                if ( !PostProgressInc( __seg__, __ctx__, 19 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 19;
            case 15:
                if ( !PreProgressInc( __seg__, __ctx__, 16 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[29],__eventData[10],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 16;
            case 16:
                if (!__ctx2__.PrepareToPendingCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 17 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 17;
            case 17:
                if ( !PreProgressInc( __seg__, __ctx__, 18 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                TopicResponsePort.SendMessage(0, __ctx1__.__responseMessage, null, null, __ctx2__, __seg__ , Microsoft.XLANGs.Core.ActivityFlags.NextActivityPersists );
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.OutgoingRqst) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.OutgoingRqst;
                goto case 18;
            case 18:
                if ( !PreProgressInc( __seg__, __ctx__, 19 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Send);
                    __edata.Messages.Add(__ctx1__.__responseMessage);
                    __edata.PortName = @"TopicResponsePort";
                    Tracker.FireEvent(__eventLocations[30],__edata,_stateMgrs[2].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 19;
            case 19:
                if ( !PreProgressInc( __seg__, __ctx__, 20 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                if (__ctx1__ != null && __ctx1__.__responseMessage != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__responseMessage);
                    __ctx1__.__responseMessage = null;
                }
                Tracker.FireEvent(__eventLocations[31],__eventData[11],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 20;
            case 20:
                if (!__ctx2__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 21 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 21;
            case 21:
                if ( !PreProgressInc( __seg__, __ctx__, 22 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx2__.OnCommit();
                goto case 22;
            case 22:
                __seg__.SegmentDone();
                _segments[1].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment3(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[3];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[3];
            ____scope36_3 __ctx3__ = (____scope36_3)_stateMgrs[3];
            __StaticSendPortOrchestration_1 __ctx1__ = (__StaticSendPortOrchestration_1)_stateMgrs[1];
            ____scope35_2 __ctx2__ = (____scope35_2)_stateMgrs[2];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[8],__eventData[3],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                __ctx1__.__logHelper.WriteLine("[StaticSendPortOrchestration] Request message received from [{0}].", (System.String)__ctx1__.__requestMessage.GetPropertyValueThrows(typeof(WCF.To)));
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 3;
            case 3:
                if ( !PreProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[9],__eventData[4],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 4;
            case 4:
                __ctx1__.__stream = __ctx1__.__requestManager.ProcessRequestReturnStream(CreateMessageWrapperForUserCode(__ctx1__.__requestMessage));
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 5;
            case 5:
                __ctx1__.__logHelper.WriteLine("[StaticSendPortOrchestration] Request message successfully processed.");
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                if (!__ctx3__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx3__.OnCommit();
                goto case 8;
            case 8:
                __seg__.SegmentDone();
                _segments[2].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment4(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[4];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[3];
            ____scope36_3 __ctx3__ = (____scope36_3)_stateMgrs[3];
            __StaticSendPortOrchestration_1 __ctx1__ = (__StaticSendPortOrchestration_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                OnBeginCatchHandler(3);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[11],__eventData[5],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[12],__eventData[3],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx1__.__logHelper.WriteLine("[StaticSendPortOrchestration] Creating error response...");
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[13],__eventData[4],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx1__.__stream = __ctx1__.__logHelper.GenerateErrorStream(__ctx3__.__ex_0);
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                __ctx1__.__logHelper.WriteLine(System.String.Format("[StaticSendPortOrchestration] {0}", __ctx3__.__ex_0.Message));
                if (__ctx3__ != null)
                    __ctx3__.__ex_0 = null;
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[16],__eventData[6],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                __ctx3__.__exv__ = null;
                OnEndCatchHandler(3, __seg__);
                __seg__.SegmentDone();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment5(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[5];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[3];
            ____scope36_3 __ctx3__ = (____scope36_3)_stateMgrs[3];
            __StaticSendPortOrchestration_1 __ctx1__ = (__StaticSendPortOrchestration_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                OnBeginCatchHandler(3);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[17],__eventData[5],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[18],__eventData[3],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx1__.__logHelper.WriteLine("[StaticSendPortOrchestration] Creating error response...");
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[19],__eventData[4],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx1__.__stream = __ctx1__.__logHelper.GenerateErrorStream("General Exception.");
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                __ctx1__.__logHelper.WriteLine("[StaticSendPortOrchestration] General Exception.");
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[22],__eventData[6],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                __ctx3__.__exv__ = null;
                OnEndCatchHandler(3, __seg__);
                __seg__.SegmentDone();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment6(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[6];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[2];
            __StaticSendPortOrchestration_1 __ctx1__ = (__StaticSendPortOrchestration_1)_stateMgrs[1];
            ____scope35_2 __ctx2__ = (____scope35_2)_stateMgrs[2];

            switch (__seg__.Progress)
            {
            case 0:
                OnBeginCatchHandler(2);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[32],__eventData[5],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[33],__eventData[3],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx1__.__logHelper.WriteLine(System.String.Format("[StaticSendPortOrchestration] {0}", __ctx2__.__ex_0.Message));
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[34],__eventData[4],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                System.Diagnostics.EventLog.WriteEntry("StaticSendPortOrchestration", __ctx2__.__ex_0.Message, System.Diagnostics.EventLogEntryType.Error);
                if (__ctx2__ != null)
                    __ctx2__.__ex_0 = null;
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                if ( !PreProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[37],__eventData[6],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 7;
            case 7:
                __ctx2__.__exv__ = null;
                OnEndCatchHandler(2, __seg__);
                __seg__.SegmentDone();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment7(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[7];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[2];
            __StaticSendPortOrchestration_1 __ctx1__ = (__StaticSendPortOrchestration_1)_stateMgrs[1];
            ____scope35_2 __ctx2__ = (____scope35_2)_stateMgrs[2];

            switch (__seg__.Progress)
            {
            case 0:
                OnBeginCatchHandler(2);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[38],__eventData[5],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[39],__eventData[3],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx1__.__logHelper.WriteLine("[StaticSendPortOrchestration] General Exception.");
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[40],__eventData[4],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                System.Diagnostics.EventLog.WriteEntry("StaticSendPortOrchestration", "General Exception.", System.Diagnostics.EventLogEntryType.Error);
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                if ( !PreProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[43],__eventData[6],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 7;
            case 7:
                __ctx2__.__exv__ = null;
                OnEndCatchHandler(2, __seg__);
                __seg__.SegmentDone();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }
    }
    //#line 261 "C:\Demos\How to integrate BizTalk Server 2010  2013 with Service Bus for Windows Server\C#\Orchestrations\DynamicSendPortOrchestration.odx"
    [Microsoft.XLANGs.BaseTypes.StaticSubscriptionAttribute(
        0, "OneWayRequestPort", "ReceiveRequest", 0, -1, true
    )]
    [Microsoft.XLANGs.BaseTypes.ActivationPredicateAttribute(
        0,
        new bool[] {
            true
        },
        new System.Type[] {
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Method)
        },
        new Microsoft.XLANGs.BaseTypes.EXLangPredicateOperator[] {
            Microsoft.XLANGs.BaseTypes.EXLangPredicateOperator.eOpEqual
        },
        new System.Object[] {
            "Dynamic"
        }
    )]
    [Microsoft.XLANGs.BaseTypes.ServicePortsAttribute(
        new Microsoft.XLANGs.BaseTypes.EXLangSParameter[] {
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.ePort|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements,
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.ePort|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eUses|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eDynamic
        },
        new System.Type[] {
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.OneWayRequestPortType),
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.DynamicResponsePortType)
        },
        new System.String[] {
            "OneWayRequestPort",
            "OneWayResponsePort"
        },
        new System.Type[] {
            null,
            null
        }
    )]
    [Microsoft.XLANGs.BaseTypes.ServiceCallTreeAttribute(
        new System.Type[] {
        },
        new System.Type[] {
        },
        new System.Type[] {
        }
    )]
    [Microsoft.XLANGs.BaseTypes.ServiceAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal,
        Microsoft.XLANGs.BaseTypes.EXLangSServiceInfo.eNone
    )]
    [System.SerializableAttribute]
    [Microsoft.XLANGs.BaseTypes.BPELExportableAttribute(false)]
    sealed internal class DynamicSendPortOrchestration : Microsoft.BizTalk.XLANGs.BTXEngine.BTXService
    {
        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal;
        public static readonly bool __execable = false;
        [Microsoft.XLANGs.BaseTypes.CallCompensationAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSCallCompensationInfo.eNone,
            new System.String[] {
            },
            new System.String[] {
            }
        )]
        public static void __bodyProxy()
        {
        }
        private static System.Guid _serviceId = Microsoft.XLANGs.Core.HashHelper.HashServiceType(typeof(DynamicSendPortOrchestration));
        private static volatile System.Guid[] _activationSubIds;

        private static new object _lockIdentity = new object();

        public static System.Guid UUID { get { return _serviceId; } }
        public override System.Guid ServiceId { get { return UUID; } }

        protected override System.Guid[] ActivationSubGuids
        {
            get { return _activationSubIds; }
            set { _activationSubIds = value; }
        }

        protected override object StaleStateLock
        {
            get { return _lockIdentity; }
        }

        protected override bool HasActivation { get { return true; } }

        internal bool IsExeced = false;

        static DynamicSendPortOrchestration()
        {
            Microsoft.BizTalk.XLANGs.BTXEngine.BTXService.CacheStaticState( _serviceId );
        }

        private void ConstructorHelper()
        {
            _segments = new Microsoft.XLANGs.Core.Segment[] {
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment0), 0, 0, 0),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment1), 1, 1, 1),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment2), 1, 2, 2),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment3), 1, 3, 3),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment4), 1, 3, 4),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment5), 1, 3, 5),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment6), 1, 2, 6),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment7), 1, 2, 7)
            };

            _Locks = 1;
            _rootContext = new __DynamicSendPortOrchestration_root_0(this);
            _stateMgrs = new Microsoft.XLANGs.Core.IStateManager[4];
            _stateMgrs[0] = _rootContext;
            FinalConstruct();
        }

        public DynamicSendPortOrchestration(System.Guid instanceId, Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession session, Microsoft.BizTalk.XLANGs.BTXEngine.BTXEvents tracker)
            : base(instanceId, session, "DynamicSendPortOrchestration", tracker)
        {
            ConstructorHelper();
        }

        public DynamicSendPortOrchestration(int callIndex, System.Guid instanceId, Microsoft.BizTalk.XLANGs.BTXEngine.BTXService parent)
            : base(callIndex, instanceId, parent, "DynamicSendPortOrchestration")
        {
            ConstructorHelper();
        }

        private const string _symInfo = @"
<XsymFile>
<ProcessFlow xmlns:om='http://schemas.microsoft.com/BizTalk/2003/DesignerData'>      <shapeType>RootShape</shapeType>      <ShapeID>f3b37908-39f7-4b82-ac11-a67ce1d90b74</ShapeID>      
<children>                          
<ShapeInfo>      <shapeType>ReceiveShape</shapeType>      <ShapeID>1ca1c5c3-e478-45d6-b470-5676dd9fc8b8</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>Receive</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>DNFPredicateShape</shapeType>      <ShapeID>27f09d1a-344d-42ce-a89c-16e3f9dd2f04</ShapeID>      <ParentLink>Receive_DNFPredicate</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>4e1dd4be-957f-4113-8652-89a67ff1041c</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>OuterScope</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>a1261e6a-0d1a-475b-83e4-4e99f07a14b3</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>InnerScope</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>edaf6f9f-2be8-4d46-8453-59c8cad8f0b3</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>BusinessLogic</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>CatchShape</shapeType>      <ShapeID>34c27f13-679a-4708-abf4-dc49912c0117</ShapeID>      <ParentLink>Scope_Catch</ParentLink>                <shapeText>System.Exception</shapeText>                      <ExceptionType>System.Exception</ExceptionType>            
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>ba4200af-1922-46f0-8abd-e91f39be4958</ShapeID>      <ParentLink>Catch_Statement</ParentLink>                <shapeText>ManageException</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>CatchShape</shapeType>      <ShapeID>56bf2308-9805-442b-aced-4062e37f84f4</ShapeID>      <ParentLink>Scope_Catch</ParentLink>                <shapeText>General Exception</shapeText>                      <ExceptionType>General Exception</ExceptionType>            
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>c01bb104-76c2-4e48-8800-247aa9e625d0</ShapeID>      <ParentLink>Catch_Statement</ParentLink>                <shapeText>ManageException</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ConstructShape</shapeType>      <ShapeID>03ec4b03-e3e5-4f9b-b596-a494b01047bc</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>ConstructMessage</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>MessageRefShape</shapeType>      <ShapeID>836ff9dd-7aaf-41ad-9eb1-b8133662d785</ShapeID>      <ParentLink>Construct_MessageRef</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageAssignmentShape</shapeType>      <ShapeID>a3a94924-da09-458d-9cd7-4d492f11d7c3</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>MessageAssignment</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>SendShape</shapeType>      <ShapeID>9e540dea-ef6d-4e3f-acad-f77faa7196e2</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>Send</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>CatchShape</shapeType>      <ShapeID>475d68b6-c34a-4c9a-aaa4-eb47f4344677</ShapeID>      <ParentLink>Scope_Catch</ParentLink>                <shapeText>System.Exception</shapeText>                      <ExceptionType>System.Exception</ExceptionType>            
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>e9b4e4a4-73f4-4a93-bfba-dd475db5c52e</ShapeID>      <ParentLink>Catch_Statement</ParentLink>                <shapeText>ManageException</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>CatchShape</shapeType>      <ShapeID>381aa46b-97cd-4133-ae89-ce93a34f13f3</ShapeID>      <ParentLink>Scope_Catch</ParentLink>                <shapeText>General Exception</shapeText>                      <ExceptionType>General Exception</ExceptionType>            
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>55c81532-5a39-4f5f-8d1c-8ba8624b1aea</ShapeID>      <ParentLink>Catch_Statement</ParentLink>                <shapeText>ManageException</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ProcessFlow><Metadata>

<TrkMetadata>
<ActionName>'DynamicSendPortOrchestration'</ActionName><IsAtomic>0</IsAtomic><Line>261</Line><Position>14</Position><ShapeID>'e211a116-cb8b-44e7-a052-0de295aa0001'</ShapeID>
</TrkMetadata>

<TrkMetadata>
<Line>277</Line><Position>115</Position><ShapeID>'1ca1c5c3-e478-45d6-b470-5676dd9fc8b8'</ShapeID>
<Messages>
	<MsgInfo><name>requestMessage</name><part>part</part><schema>Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorRequest</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'??__scope38'</ActionName><IsAtomic>0</IsAtomic><Line>282</Line><Position>13</Position><ShapeID>'4e1dd4be-957f-4113-8652-89a67ff1041c'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'??__scope39'</ActionName><IsAtomic>0</IsAtomic><Line>287</Line><Position>21</Position><ShapeID>'a1261e6a-0d1a-475b-83e4-4e99f07a14b3'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>292</Line><Position>48</Position><ShapeID>'edaf6f9f-2be8-4d46-8453-59c8cad8f0b3'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>300</Line><Position>29</Position><ShapeID>'34c27f13-679a-4708-abf4-dc49912c0117'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>303</Line><Position>52</Position><ShapeID>'ba4200af-1922-46f0-8abd-e91f39be4958'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>308</Line><Position>29</Position><ShapeID>'56bf2308-9805-442b-aced-4062e37f84f4'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>311</Line><Position>52</Position><ShapeID>'c01bb104-76c2-4e48-8800-247aa9e625d0'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>318</Line><Position>21</Position><ShapeID>'03ec4b03-e3e5-4f9b-b596-a494b01047bc'</ShapeID>
<Messages>
	<MsgInfo><name>responseMessage</name><part>part</part><schema>Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>340</Line><Position>21</Position><ShapeID>'9e540dea-ef6d-4e3f-acad-f77faa7196e2'</ShapeID>
<Messages>
	<MsgInfo><name>responseMessage</name><part>part</part><schema>Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>345</Line><Position>21</Position><ShapeID>'475d68b6-c34a-4c9a-aaa4-eb47f4344677'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>348</Line><Position>44</Position><ShapeID>'e9b4e4a4-73f4-4a93-bfba-dd475db5c52e'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>354</Line><Position>21</Position><ShapeID>'381aa46b-97cd-4133-ae89-ce93a34f13f3'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>357</Line><Position>44</Position><ShapeID>'55c81532-5a39-4f5f-8d1c-8ba8624b1aea'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>
</Metadata>
</XsymFile>";

        public override string odXml { get { return _symODXML; } }

        private const string _symODXML = @"
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<om:MetaModel MajorVersion='1' MinorVersion='3' Core='2b131234-7959-458d-834f-2dc0769ce683' ScheduleModel='66366196-361d-448d-976f-cab5e87496d2' xmlns:om='http://schemas.microsoft.com/BizTalk/2003/DesignerData'>
    <om:Element Type='Module' OID='6ed55bb3-6b8f-4ebe-a6d8-235a368fe130' LowerBound='1.1' HigherBound='119.1'>
        <om:Property Name='ReportToAnalyst' Value='True' />
        <om:Property Name='Name' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations' />
        <om:Property Name='Signal' Value='False' />
        <om:Element Type='ServiceDeclaration' OID='9dc77a0c-9aba-4fa7-b48d-dcabfae0e123' ParentLink='Module_ServiceDeclaration' LowerBound='11.1' HigherBound='118.1'>
            <om:Property Name='InitializedTransactionType' Value='True' />
            <om:Property Name='IsInvokable' Value='False' />
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='DynamicSendPortOrchestration' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='VariableDeclaration' OID='036b9c44-92b0-43df-a864-a3ba694bf913' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='20.1' HigherBound='21.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.Guid' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='guid' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='574e8fbd-c2cd-4731-8c13-a472514f0310' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='21.1' HigherBound='22.1'>
                <om:Property Name='UseDefaultConstructor' Value='True' />
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.ResponseManager' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='responseManager' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='2dd44047-d947-4388-a713-5ee45158c5c0' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='22.1' HigherBound='23.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.IO.Stream' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='stream' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='45de58c0-18ef-4fa5-8e80-16440ae2b18e' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='23.1' HigherBound='24.1'>
                <om:Property Name='UseDefaultConstructor' Value='True' />
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.RequestManager' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='requestManager' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='78824c75-cd3e-4919-9534-8ae4aa6eb77d' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='24.1' HigherBound='25.1'>
                <om:Property Name='UseDefaultConstructor' Value='True' />
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.LogHelper' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='logHelper' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='906afc82-82d5-4ba4-bb1f-8b8527b4551c' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='18.1' HigherBound='19.1'>
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='responseMessage' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='369c6b07-78c1-4c6c-ae0a-404de8ce7872' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='19.1' HigherBound='20.1'>
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorRequest' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='requestMessage' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='ServiceBody' OID='f3b37908-39f7-4b82-ac11-a67ce1d90b74' ParentLink='ServiceDeclaration_ServiceBody'>
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='Receive' OID='1ca1c5c3-e478-45d6-b470-5676dd9fc8b8' ParentLink='ServiceBody_Statement' LowerBound='27.1' HigherBound='32.1'>
                    <om:Property Name='Activate' Value='True' />
                    <om:Property Name='PortName' Value='OneWayRequestPort' />
                    <om:Property Name='MessageName' Value='requestMessage' />
                    <om:Property Name='OperationName' Value='ReceiveRequest' />
                    <om:Property Name='OperationMessageName' Value='Request' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Receive' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='DNFPredicate' OID='27f09d1a-344d-42ce-a89c-16e3f9dd2f04' ParentLink='Receive_DNFPredicate'>
                        <om:Property Name='LHS' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Method' />
                        <om:Property Name='RHS' Value='&quot;Dynamic&quot;' />
                        <om:Property Name='Grouping' Value='AND' />
                        <om:Property Name='Operator' Value='Equals' />
                        <om:Property Name='Signal' Value='False' />
                    </om:Element>
                </om:Element>
                <om:Element Type='Scope' OID='4e1dd4be-957f-4113-8652-89a67ff1041c' ParentLink='ServiceBody_Statement' LowerBound='32.1' HigherBound='116.1'>
                    <om:Property Name='InitializedTransactionType' Value='True' />
                    <om:Property Name='IsSynchronized' Value='False' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='OuterScope' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='Scope' OID='a1261e6a-0d1a-475b-83e4-4e99f07a14b3' ParentLink='ComplexStatement_Statement' LowerBound='37.1' HigherBound='68.1'>
                        <om:Property Name='InitializedTransactionType' Value='True' />
                        <om:Property Name='IsSynchronized' Value='False' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='InnerScope' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='VariableAssignment' OID='edaf6f9f-2be8-4d46-8453-59c8cad8f0b3' ParentLink='ComplexStatement_Statement' LowerBound='42.1' HigherBound='47.1'>
                            <om:Property Name='Expression' Value='logHelper.WriteLine(&quot;[DynamicSendPortOrchestration] Request message received from [{0}].&quot;, &#xD;&#xA;                    requestMessage(WCF.To));&#xD;&#xA;stream = requestManager.ProcessRequestReturnStream(requestMessage);&#xD;&#xA;logHelper.WriteLine(&quot;[DynamicSendPortOrchestration] Request message successfully processed.&quot;);&#xD;&#xA;' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='BusinessLogic' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                        <om:Element Type='Catch' OID='34c27f13-679a-4708-abf4-dc49912c0117' ParentLink='Scope_Catch' LowerBound='50.1' HigherBound='58.1'>
                            <om:Property Name='ExceptionName' Value='ex' />
                            <om:Property Name='ExceptionType' Value='System.Exception' />
                            <om:Property Name='IsFaultMessage' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='System.Exception' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='VariableAssignment' OID='ba4200af-1922-46f0-8abd-e91f39be4958' ParentLink='Catch_Statement' LowerBound='53.1' HigherBound='57.1'>
                                <om:Property Name='Expression' Value='logHelper.WriteLine(&quot;[DynamicSendPortOrchestration] Creating error response...&quot;);&#xD;&#xA;stream = logHelper.GenerateErrorStream(ex);&#xD;&#xA;logHelper.WriteLine(System.String.Format(&quot;[DynamicSendPortOrchestration] {0}&quot;, ex.Message));&#xD;&#xA;' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='ManageException' />
                                <om:Property Name='Signal' Value='False' />
                            </om:Element>
                        </om:Element>
                        <om:Element Type='Catch' OID='56bf2308-9805-442b-aced-4062e37f84f4' ParentLink='Scope_Catch' LowerBound='58.1' HigherBound='66.1'>
                            <om:Property Name='ExceptionType' Value='General Exception' />
                            <om:Property Name='IsFaultMessage' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='General Exception' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='VariableAssignment' OID='c01bb104-76c2-4e48-8800-247aa9e625d0' ParentLink='Catch_Statement' LowerBound='61.1' HigherBound='65.1'>
                                <om:Property Name='Expression' Value='logHelper.WriteLine(&quot;[DynamicSendPortOrchestration] Creating error response...&quot;);&#xD;&#xA;stream = logHelper.GenerateErrorStream(&quot;General Exception.&quot;);&#xD;&#xA;logHelper.WriteLine(&quot;[DynamicSendPortOrchestration] General Exception.&quot;);' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='ManageException' />
                                <om:Property Name='Signal' Value='False' />
                            </om:Element>
                        </om:Element>
                    </om:Element>
                    <om:Element Type='Construct' OID='03ec4b03-e3e5-4f9b-b596-a494b01047bc' ParentLink='ComplexStatement_Statement' LowerBound='68.1' HigherBound='90.1'>
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='ConstructMessage' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='MessageRef' OID='836ff9dd-7aaf-41ad-9eb1-b8133662d785' ParentLink='Construct_MessageRef' LowerBound='69.31' HigherBound='69.46'>
                            <om:Property Name='Ref' Value='responseMessage' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                        <om:Element Type='MessageAssignment' OID='a3a94924-da09-458d-9cd7-4d492f11d7c3' ParentLink='ComplexStatement_Statement' LowerBound='71.1' HigherBound='89.1'>
                            <om:Property Name='Expression' Value='responseMessage = null;&#xD;&#xA;responseManager.SetResponse(responseMessage, stream);&#xD;&#xA;responseMessage(*) = requestMessage(*);&#xD;&#xA;guid = System.Guid.NewGuid();&#xD;&#xA;responseMessage(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Application) = &quot;ServiceBusSample&quot;;&#xD;&#xA;responseMessage(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.MessageId) = guid.ToString();&#xD;&#xA;responseMessage(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.CorrelationId) = responseManager.GetMessageId(requestMessage);&#xD;&#xA;responseMessage(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.SessionId) = responseManager.GetReplyToSessionId(requestMessage);&#xD;&#xA;responseMessage(WCF.InboundHeaders) = &quot;&quot;;&#xD;&#xA;responseMessage(WCF.Action)= responseManager.GetAction(requestMessage);&#xD;&#xA;responseMessage(WCF.BindingType)=&quot;netMessagingBinding&quot;;&#xD;&#xA;responseMessage(WCF.EnableTransaction) = false;&#xD;&#xA;responseMessage(WCF.BindingConfiguration) = responseManager.GetBindingConfiguration(requestMessage);&#xD;&#xA;responseMessage(WCF.EndpointBehaviorConfiguration) = responseManager.GetEndpointBehaviorConfiguration(requestMessage);&#xD;&#xA;OneWayResponsePort(Microsoft.XLANGs.BaseTypes.Address) = responseManager.GetReplyTo(requestMessage);&#xD;&#xA;OneWayResponsePort(Microsoft.XLANGs.BaseTypes.TransportType)=&quot;WCF-Custom&quot;;&#xD;&#xA;&#xD;&#xA;' />
                            <om:Property Name='ReportToAnalyst' Value='False' />
                            <om:Property Name='Name' Value='MessageAssignment' />
                            <om:Property Name='Signal' Value='True' />
                        </om:Element>
                    </om:Element>
                    <om:Element Type='Send' OID='9e540dea-ef6d-4e3f-acad-f77faa7196e2' ParentLink='ComplexStatement_Statement' LowerBound='90.1' HigherBound='92.1'>
                        <om:Property Name='PortName' Value='OneWayResponsePort' />
                        <om:Property Name='MessageName' Value='responseMessage' />
                        <om:Property Name='OperationName' Value='SendResponse' />
                        <om:Property Name='OperationMessageName' Value='Response' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='Send' />
                        <om:Property Name='Signal' Value='True' />
                    </om:Element>
                    <om:Element Type='Catch' OID='475d68b6-c34a-4c9a-aaa4-eb47f4344677' ParentLink='Scope_Catch' LowerBound='95.1' HigherBound='104.1'>
                        <om:Property Name='ExceptionName' Value='ex' />
                        <om:Property Name='ExceptionType' Value='System.Exception' />
                        <om:Property Name='IsFaultMessage' Value='False' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='System.Exception' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='VariableAssignment' OID='e9b4e4a4-73f4-4a93-bfba-dd475db5c52e' ParentLink='Catch_Statement' LowerBound='98.1' HigherBound='103.1'>
                            <om:Property Name='Expression' Value='logHelper.WriteLine(System.String.Format(&quot;[DynamicSendPortOrchestration] {0}&quot;, ex.Message));&#xD;&#xA;System.Diagnostics.EventLog.WriteEntry(&quot;DynamicSendPortOrchestration&quot;, &#xD;&#xA;                                       ex.Message, &#xD;&#xA;                                       System.Diagnostics.EventLogEntryType.Error);' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='ManageException' />
                            <om:Property Name='Signal' Value='True' />
                        </om:Element>
                    </om:Element>
                    <om:Element Type='Catch' OID='381aa46b-97cd-4133-ae89-ce93a34f13f3' ParentLink='Scope_Catch' LowerBound='104.1' HigherBound='114.1'>
                        <om:Property Name='ExceptionType' Value='General Exception' />
                        <om:Property Name='IsFaultMessage' Value='False' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='General Exception' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='VariableAssignment' OID='55c81532-5a39-4f5f-8d1c-8ba8624b1aea' ParentLink='Catch_Statement' LowerBound='107.1' HigherBound='113.1'>
                            <om:Property Name='Expression' Value='logHelper.WriteLine(&quot;[DynamicSendPortOrchestration] General Exception.&quot;);&#xD;&#xA;System.Diagnostics.EventLog.WriteEntry(&quot;DynamicSendPortOrchestration&quot;, &#xD;&#xA;                                       &quot;General Exception.&quot;, &#xD;&#xA;                                       System.Diagnostics.EventLogEntryType.Error);&#xD;&#xA;&#xD;&#xA;' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='ManageException' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                    </om:Element>
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='199cffe5-e150-4623-9649-3f3e767a231e' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='14.1' HigherBound='16.1'>
                <om:Property Name='PortModifier' Value='Implements' />
                <om:Property Name='Orientation' Value='Left' />
                <om:Property Name='PortIndex' Value='6' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.OneWayRequestPortType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='OneWayRequestPort' />
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='DirectBindingAttribute' OID='0810ebec-48e5-443d-a3d1-a86c895ec76e' ParentLink='PortDeclaration_CLRAttribute' LowerBound='14.1' HigherBound='15.1'>
                    <om:Property Name='DirectBindingType' Value='MessageBox' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='d4eed45f-544d-48bb-a1c9-d6afe048748e' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='16.1' HigherBound='18.1'>
                <om:Property Name='PortModifier' Value='Uses' />
                <om:Property Name='Orientation' Value='Left' />
                <om:Property Name='PortIndex' Value='56' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Orchestrations.DynamicResponsePortType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='OneWayResponsePort' />
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='PhysicalBindingAttribute' OID='fdbf3fec-19e9-4f9f-82dc-8244ccace44a' ParentLink='PortDeclaration_CLRAttribute' LowerBound='16.1' HigherBound='17.1'>
                    <om:Property Name='InPipeline' Value='Microsoft.BizTalk.DefaultPipelines.XMLReceive' />
                    <om:Property Name='OutPipeline' Value='Microsoft.BizTalk.DefaultPipelines.PassThruTransmit' />
                    <om:Property Name='TransportType' Value='HTTP' />
                    <om:Property Name='URI' Value='http://tempURI' />
                    <om:Property Name='IsDynamic' Value='True' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
        </om:Element>
        <om:Element Type='PortType' OID='9a39dd8c-4722-4ad3-ae4d-06848371f5f1' ParentLink='Module_PortType' LowerBound='4.1' HigherBound='11.1'>
            <om:Property Name='Synchronous' Value='False' />
            <om:Property Name='TypeModifier' Value='Public' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='DynamicResponsePortType' />
            <om:Property Name='Signal' Value='False' />
            <om:Element Type='OperationDeclaration' OID='bc4f1546-7d04-49e1-8c30-034c4e0e5633' ParentLink='PortType_OperationDeclaration' LowerBound='6.1' HigherBound='10.1'>
                <om:Property Name='OperationType' Value='OneWay' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='SendResponse' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='MessageRef' OID='816f2827-ad89-4599-979d-b9da3df94eb8' ParentLink='OperationDeclaration_RequestMessageRef' LowerBound='8.13' HigherBound='8.101'>
                    <om:Property Name='Ref' Value='Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Response' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
            </om:Element>
        </om:Element>
    </om:Element>
</om:MetaModel>
";

        [System.SerializableAttribute]
        public class __DynamicSendPortOrchestration_root_0 : Microsoft.XLANGs.Core.ServiceContext
        {
            public __DynamicSendPortOrchestration_root_0(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "DynamicSendPortOrchestration")
            {
            }

            public override int Index { get { return 0; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[0]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[0]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                DynamicSendPortOrchestration __svc__ = (DynamicSendPortOrchestration)_service;
                __DynamicSendPortOrchestration_root_0 __ctx0__ = (__DynamicSendPortOrchestration_root_0)(__svc__._stateMgrs[0]);

                if (__svc__.OneWayRequestPort != null)
                {
                    __svc__.OneWayRequestPort.Close(this, null);
                    __svc__.OneWayRequestPort = null;
                }
                base.Finally();
            }

            internal Microsoft.XLANGs.Core.SubscriptionWrapper __subWrapper0;
        }


        [System.SerializableAttribute]
        public class __DynamicSendPortOrchestration_1 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public __DynamicSendPortOrchestration_1(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "DynamicSendPortOrchestration")
            {
            }

            public override int Index { get { return 1; } }

            public override bool CombineParentCommit { get { return true; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[1]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[1]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                DynamicSendPortOrchestration __svc__ = (DynamicSendPortOrchestration)_service;
                __DynamicSendPortOrchestration_root_0 __ctx0__ = (__DynamicSendPortOrchestration_root_0)(__svc__._stateMgrs[0]);
                __DynamicSendPortOrchestration_1 __ctx1__ = (__DynamicSendPortOrchestration_1)(__svc__._stateMgrs[1]);

                if (__svc__.OneWayResponsePort != null)
                {
                    __svc__.OneWayResponsePort.Close(this, null);
                    __svc__.OneWayResponsePort = null;
                }
                if (__ctx1__ != null)
                    __ctx1__.__logHelper = null;
                if (__ctx1__ != null && __ctx1__.__requestMessage != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__requestMessage);
                    __ctx1__.__requestMessage = null;
                }
                if (__ctx1__ != null)
                    __ctx1__.__responseManager = null;
                if (__ctx1__ != null)
                    __ctx1__.__requestManager = null;
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("responseMessage")]
            public __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse __responseMessage;
            [Microsoft.XLANGs.Core.UserVariableAttribute("requestMessage")]
            public __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest __requestMessage;
            [Microsoft.XLANGs.Core.UserVariableAttribute("guid")]
            internal System.Guid __guid;
            [Microsoft.XLANGs.Core.UserVariableAttribute("responseManager")]
            internal Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.ResponseManager __responseManager;
            [Microsoft.XLANGs.Core.UserVariableAttribute("stream")]
            internal System.IO.Stream __stream;
            [Microsoft.XLANGs.Core.UserVariableAttribute("requestManager")]
            internal Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.RequestManager __requestManager;
            [Microsoft.XLANGs.Core.UserVariableAttribute("logHelper")]
            internal Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.LogHelper __logHelper;
        }


        [System.SerializableAttribute]
        public class ____scope38_2 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public ____scope38_2(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "??__scope38")
            {
            }

            public override int Index { get { return 2; } }

            public override bool CombineParentCommit { get { return true; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[2]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[2]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Microsoft.XLANGs.Core.Segment __seg__;
                Microsoft.XLANGs.Core.FaultReceiveException __fault__;

                __exv__ = _exception;
                if (!(__exv__ is Microsoft.XLANGs.Core.UnknownException))
                {
                    __fault__ = __exv__ as Microsoft.XLANGs.Core.FaultReceiveException;
                    if ((__fault__ == null) && (__exv__ is System.Exception))
                    {
                        __seg__ = _service._segments[6];
                        __seg__.Reset(1);
                        __seg__.PredecessorDone(_service);
                        return true;
                    }
                }

                __seg__ = _service._segments[7];
                __seg__.Reset(1);
                __seg__.PredecessorDone(_service);
                return true;
            }

            public override void Finally()
            {
                DynamicSendPortOrchestration __svc__ = (DynamicSendPortOrchestration)_service;
                ____scope38_2 __ctx2__ = (____scope38_2)(__svc__._stateMgrs[2]);
                __DynamicSendPortOrchestration_1 __ctx1__ = (__DynamicSendPortOrchestration_1)(__svc__._stateMgrs[1]);

                if (__ctx1__ != null)
                    __ctx1__.__stream = null;
                if (__ctx2__ != null)
                    __ctx2__.__ex_0 = null;
                if (__ctx1__ != null && __ctx1__.__responseMessage != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__responseMessage);
                    __ctx1__.__responseMessage = null;
                }
                base.Finally();
            }

            internal object __exv__;
            internal System.Exception __ex_0
            {
                get { return (System.Exception)__exv__; }
                set { __exv__ = value; }
            }
        }


        [System.SerializableAttribute]
        public class ____scope39_3 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public ____scope39_3(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "??__scope39")
            {
            }

            public override int Index { get { return 3; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[3]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[3]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Microsoft.XLANGs.Core.Segment __seg__;
                Microsoft.XLANGs.Core.FaultReceiveException __fault__;

                __exv__ = _exception;
                if (!(__exv__ is Microsoft.XLANGs.Core.UnknownException))
                {
                    __fault__ = __exv__ as Microsoft.XLANGs.Core.FaultReceiveException;
                    if ((__fault__ == null) && (__exv__ is System.Exception))
                    {
                        __seg__ = _service._segments[4];
                        __seg__.Reset(1);
                        __seg__.PredecessorDone(_service);
                        return true;
                    }
                }

                __seg__ = _service._segments[5];
                __seg__.Reset(1);
                __seg__.PredecessorDone(_service);
                return true;
            }

            public override void Finally()
            {
                DynamicSendPortOrchestration __svc__ = (DynamicSendPortOrchestration)_service;
                ____scope39_3 __ctx3__ = (____scope39_3)(__svc__._stateMgrs[3]);

                if (__ctx3__ != null)
                    __ctx3__.__ex_0 = null;
                base.Finally();
            }

            internal object __exv__;
            internal System.Exception __ex_0
            {
                get { return (System.Exception)__exv__; }
                set { __exv__ = value; }
            }
        }

        private static Microsoft.XLANGs.Core.CorrelationType[] _correlationTypes = null;
        public override Microsoft.XLANGs.Core.CorrelationType[] CorrelationTypes { get { return _correlationTypes; } }

        private static System.Guid[] _convoySetIds;

        public override System.Guid[] ConvoySetGuids
        {
            get { return _convoySetIds; }
            set { _convoySetIds = value; }
        }

        public static object[] StaticConvoySetInformation
        {
            get {
                return null;
            }
        }

        [Microsoft.XLANGs.BaseTypes.DirectBindingAttribute()]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("OneWayRequestPort")]
        internal OneWayRequestPortType OneWayRequestPort;
        [Microsoft.XLANGs.BaseTypes.PhysicalBindingAttribute(typeof(Microsoft.BizTalk.DefaultPipelines.PassThruTransmit))]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eUses|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eDynamic
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("OneWayResponsePort")]
        internal DynamicResponsePortType OneWayResponsePort;  // lock index = 0
        private static Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Method _prop_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_Method = new Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Method();

        sealed private class PredicateSet0_0 : Microsoft.XLANGs.Core.PredicateGroup
        {
            public PredicateSet0_0() : base(1)
            {
                Add(new Microsoft.XLANGs.Core.FullySpecifiedPredicate(_prop_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_Method, Microsoft.XLANGs.Core.PredicateBase.Operators.eEqual, "Dynamic"));
            }
        }


        private static Microsoft.XLANGs.Core.PredicateGroup[] _predicates0 = {
            new PredicateSet0_0()
        };


        public static Microsoft.XLANGs.Core.PortInfo[] _portInfo = new Microsoft.XLANGs.Core.PortInfo[] {
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {OneWayRequestPortType.ReceiveRequest},
                                               typeof(DynamicSendPortOrchestration).GetField("OneWayRequestPort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.implements,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(DynamicSendPortOrchestration), "OneWayRequestPort"),
                                               null),
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {DynamicResponsePortType.SendResponse},
                                               typeof(DynamicSendPortOrchestration).GetField("OneWayResponsePort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.uses,
                                               true,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(DynamicSendPortOrchestration), "OneWayResponsePort"),
                                               null)
        };

        public override Microsoft.XLANGs.Core.PortInfo[] PortInformation
        {
            get { return _portInfo; }
        }

        static public System.Collections.Hashtable PortsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[_portInfo[0].Name] = _portInfo[0];
                h[_portInfo[1].Name] = _portInfo[1];
                return h;
            }
        }

        public static System.Type[] InvokedServicesTypes
        {
            get
            {
                return new System.Type[] {
                    // type of each service invoked by this service
                };
            }
        }

        public static System.Type[] CalledServicesTypes
        {
            get
            {
                return new System.Type[] {
                };
            }
        }

        public static System.Type[] ExecedServicesTypes
        {
            get
            {
                return new System.Type[] {
                };
            }
        }

        public static object[] StaticSubscriptionsInformation {
            get {
                return new object[1]{
                     new object[5] { _portInfo[0], 0, _predicates0 , -1, true }
                };
            }
        }

        public static Microsoft.XLANGs.RuntimeTypes.Location[] __eventLocations = new Microsoft.XLANGs.RuntimeTypes.Location[] {
            new Microsoft.XLANGs.RuntimeTypes.Location(0, "00000000-0000-0000-0000-000000000000", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(1, "1ca1c5c3-e478-45d6-b470-5676dd9fc8b8", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(2, "1ca1c5c3-e478-45d6-b470-5676dd9fc8b8", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(3, "00000000-0000-0000-0000-000000000000", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(4, "4e1dd4be-957f-4113-8652-89a67ff1041c", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(5, "00000000-0000-0000-0000-000000000000", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(6, "a1261e6a-0d1a-475b-83e4-4e99f07a14b3", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(7, "00000000-0000-0000-0000-000000000000", 3, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(8, "edaf6f9f-2be8-4d46-8453-59c8cad8f0b3", 3, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(9, "edaf6f9f-2be8-4d46-8453-59c8cad8f0b3", 3, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(10, "00000000-0000-0000-0000-000000000000", 3, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(11, "34c27f13-679a-4708-abf4-dc49912c0117", 4, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(12, "ba4200af-1922-46f0-8abd-e91f39be4958", 4, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(13, "ba4200af-1922-46f0-8abd-e91f39be4958", 4, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(14, "00000000-0000-0000-0000-000000000000", 4, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(15, "00000000-0000-0000-0000-000000000000", 4, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(16, "34c27f13-679a-4708-abf4-dc49912c0117", 4, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(17, "56bf2308-9805-442b-aced-4062e37f84f4", 5, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(18, "c01bb104-76c2-4e48-8800-247aa9e625d0", 5, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(19, "c01bb104-76c2-4e48-8800-247aa9e625d0", 5, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(20, "00000000-0000-0000-0000-000000000000", 5, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(21, "00000000-0000-0000-0000-000000000000", 5, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(22, "56bf2308-9805-442b-aced-4062e37f84f4", 5, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(23, "a1261e6a-0d1a-475b-83e4-4e99f07a14b3", 2, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(24, "03ec4b03-e3e5-4f9b-b596-a494b01047bc", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(25, "03ec4b03-e3e5-4f9b-b596-a494b01047bc", 2, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(26, "9e540dea-ef6d-4e3f-acad-f77faa7196e2", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(27, "9e540dea-ef6d-4e3f-acad-f77faa7196e2", 2, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(28, "475d68b6-c34a-4c9a-aaa4-eb47f4344677", 6, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(29, "e9b4e4a4-73f4-4a93-bfba-dd475db5c52e", 6, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(30, "e9b4e4a4-73f4-4a93-bfba-dd475db5c52e", 6, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(31, "00000000-0000-0000-0000-000000000000", 6, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(32, "00000000-0000-0000-0000-000000000000", 6, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(33, "475d68b6-c34a-4c9a-aaa4-eb47f4344677", 6, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(34, "381aa46b-97cd-4133-ae89-ce93a34f13f3", 7, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(35, "55c81532-5a39-4f5f-8d1c-8ba8624b1aea", 7, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(36, "55c81532-5a39-4f5f-8d1c-8ba8624b1aea", 7, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(37, "00000000-0000-0000-0000-000000000000", 7, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(38, "00000000-0000-0000-0000-000000000000", 7, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(39, "381aa46b-97cd-4133-ae89-ce93a34f13f3", 7, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(40, "4e1dd4be-957f-4113-8652-89a67ff1041c", 1, false)
        };

        public override Microsoft.XLANGs.RuntimeTypes.Location[] EventLocations
        {
            get { return __eventLocations; }
        }

        public static Microsoft.XLANGs.RuntimeTypes.EventData[] __eventData = new Microsoft.XLANGs.RuntimeTypes.EventData[] {
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Body),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Receive),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Scope),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Expression),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Expression),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Catch),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Catch),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Scope),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Construct),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Send),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Body)
        };

        public static int[] __progressLocation0 = new int[] { 0,0,0,3,3,};
        public static int[] __progressLocation1 = new int[] { 0,0,1,1,2,2,2,2,4,4,4,40,3,3,3,3,};
        public static int[] __progressLocation2 = new int[] { 6,6,6,6,23,24,24,25,26,26,26,27,27,27,27,};
        public static int[] __progressLocation3 = new int[] { 8,8,8,9,9,9,9,9,9,};
        public static int[] __progressLocation4 = new int[] { 11,11,12,12,13,13,13,16,16,};
        public static int[] __progressLocation5 = new int[] { 17,17,18,18,19,19,19,22,22,};
        public static int[] __progressLocation6 = new int[] { 28,28,29,29,30,30,33,33,};
        public static int[] __progressLocation7 = new int[] { 34,34,35,35,36,36,39,39,};

        public static int[][] __progressLocations = new int[8] [] {__progressLocation0,__progressLocation1,__progressLocation2,__progressLocation3,__progressLocation4,__progressLocation5,__progressLocation6,__progressLocation7};
        public override int[][] ProgressLocations {get {return __progressLocations;} }

        public Microsoft.XLANGs.Core.StopConditions segment0(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[0];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[0];
            __DynamicSendPortOrchestration_root_0 __ctx0__ = (__DynamicSendPortOrchestration_root_0)_stateMgrs[0];
            __DynamicSendPortOrchestration_1 __ctx1__ = (__DynamicSendPortOrchestration_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                OneWayRequestPort = new OneWayRequestPortType(0, this);
                OneWayResponsePort = new DynamicResponsePortType(1, this);
                __ctx__.PrologueCompleted = true;
                __ctx0__.__subWrapper0 = new Microsoft.XLANGs.Core.SubscriptionWrapper(ActivationSubGuids[0], OneWayRequestPort, this);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.Initialized) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.Initialized;
                goto case 1;
            case 1:
                __ctx1__ = new __DynamicSendPortOrchestration_1(this);
                _stateMgrs[1] = __ctx1__;
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                __ctx0__.StartContext(__seg__, __ctx1__);
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 3:
                if (!__ctx0__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                __ctx1__.Finally();
                ServiceDone(__seg__, (Microsoft.XLANGs.Core.Context)_stateMgrs[0]);
                __ctx0__.OnCommit();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Envelope __msgEnv__ = null;
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[1];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[1];
            __DynamicSendPortOrchestration_root_0 __ctx0__ = (__DynamicSendPortOrchestration_root_0)_stateMgrs[0];
            ____scope38_2 __ctx2__ = (____scope38_2)_stateMgrs[2];
            __DynamicSendPortOrchestration_1 __ctx1__ = (__DynamicSendPortOrchestration_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx1__.__guid = default(System.Guid);
                __ctx1__.__responseManager = default(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.ResponseManager);
                __ctx1__.__stream = default(System.IO.Stream);
                __ctx1__.__requestManager = default(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.RequestManager);
                __ctx1__.__logHelper = default(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.LogHelper);
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[0],__eventData[0],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[1],__eventData[1],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                if (!OneWayRequestPort.GetMessageId(__ctx0__.__subWrapper0.getSubscription(this), __seg__, __ctx1__, out __msgEnv__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if (__ctx1__.__requestMessage != null)
                    __ctx1__.UnrefMessage(__ctx1__.__requestMessage);
                __ctx1__.__requestMessage = new __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest("requestMessage", __ctx1__);
                __ctx1__.RefMessage(__ctx1__.__requestMessage);
                OneWayRequestPort.ReceiveMessage(0, __msgEnv__, __ctx1__.__requestMessage, null, (Microsoft.XLANGs.Core.Context)_stateMgrs[1], __seg__);
                if (OneWayRequestPort != null)
                {
                    OneWayRequestPort.Close(__ctx1__, __seg__);
                    OneWayRequestPort = null;
                }
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Receive);
                    __edata.Messages.Add(__ctx1__.__requestMessage);
                    __edata.PortName = @"OneWayRequestPort";
                    Tracker.FireEvent(__eventLocations[2],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx1__.__responseManager = new Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.ResponseManager();
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                __ctx1__.__requestManager = new Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.RequestManager();
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                __ctx1__.__logHelper = new Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.BusinessLogic.LogHelper();
                if ( !PostProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 8;
            case 8:
                if ( !PreProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[4],__eventData[2],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 9;
            case 9:
                __ctx2__ = new ____scope38_2(this);
                _stateMgrs[2] = __ctx2__;
                if ( !PostProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 10;
            case 10:
                __ctx1__.StartContext(__seg__, __ctx2__);
                if ( !PostProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 11:
                if ( !PreProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                if (__ctx1__ != null)
                    __ctx1__.__logHelper = null;
                if (__ctx1__ != null)
                    __ctx1__.__requestManager = null;
                if (__ctx1__ != null)
                    __ctx1__.__responseManager = null;
                if (__ctx1__ != null && __ctx1__.__requestMessage != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__requestMessage);
                    __ctx1__.__requestMessage = null;
                }
                if (OneWayResponsePort != null)
                {
                    OneWayResponsePort.Close(__ctx1__, __seg__);
                    OneWayResponsePort = null;
                }
                Tracker.FireEvent(__eventLocations[40],__eventData[7],_stateMgrs[1].TrackDataStream );
                __ctx2__.Finally();
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 12;
            case 12:
                if ( !PreProgressInc( __seg__, __ctx__, 13 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[3],__eventData[10],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 13;
            case 13:
                if (!__ctx1__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 14 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 14;
            case 14:
                if ( !PreProgressInc( __seg__, __ctx__, 15 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx1__.OnCommit();
                goto case 15;
            case 15:
                __seg__.SegmentDone();
                _segments[0].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment2(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[2];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[2];
            ____scope39_3 __ctx3__ = (____scope39_3)_stateMgrs[3];
            __DynamicSendPortOrchestration_root_0 __ctx0__ = (__DynamicSendPortOrchestration_root_0)_stateMgrs[0];
            ____scope38_2 __ctx2__ = (____scope38_2)_stateMgrs[2];
            __DynamicSendPortOrchestration_1 __ctx1__ = (__DynamicSendPortOrchestration_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[6],__eventData[2],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                __ctx3__ = new ____scope39_3(this);
                _stateMgrs[3] = __ctx3__;
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 3;
            case 3:
                __ctx2__.StartContext(__seg__, __ctx3__);
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[23],__eventData[7],_stateMgrs[2].TrackDataStream );
                __ctx3__.Finally();
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                if ( !PreProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[24],__eventData[8],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 6;
            case 6:
                {
                    __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse __responseMessage = new __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse("responseMessage", __ctx1__);

                    __responseMessage.part.LoadFrom(null);
                    __ctx1__.__responseManager.SetResponse(CreateMessageWrapperForUserCode(__responseMessage), __ctx1__.__stream);
                    if (__ctx1__ != null)
                        __ctx1__.__stream = null;
                    __responseMessage.CopyContextPropertiesFrom(__ctx1__.__requestMessage);
                    __ctx1__.__guid = System.Guid.NewGuid();
                    __responseMessage.SetPropertyValue(typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.Application), "ServiceBusSample");
                    __responseMessage.SetPropertyValue(typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.MessageId), __ctx1__.__guid.ToString());
                    __responseMessage.SetPropertyValue(typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.CorrelationId), __ctx1__.__responseManager.GetMessageId(CreateMessageWrapperForUserCode(__ctx1__.__requestMessage)));
                    __responseMessage.SetPropertyValue(typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.PropertySchemas.SessionId), __ctx1__.__responseManager.GetReplyToSessionId(CreateMessageWrapperForUserCode(__ctx1__.__requestMessage)));
                    __responseMessage.SetPropertyValue(typeof(WCF.InboundHeaders), "");
                    __responseMessage.SetPropertyValue(typeof(WCF.Action), __ctx1__.__responseManager.GetAction(CreateMessageWrapperForUserCode(__ctx1__.__requestMessage)));
                    __responseMessage.SetPropertyValue(typeof(WCF.BindingType), "netMessagingBinding");
                    __responseMessage.SetPropertyValue(typeof(WCF.EnableTransaction), false);
                    __responseMessage.SetPropertyValue(typeof(WCF.BindingConfiguration), __ctx1__.__responseManager.GetBindingConfiguration(CreateMessageWrapperForUserCode(__ctx1__.__requestMessage)));
                    __responseMessage.SetPropertyValue(typeof(WCF.EndpointBehaviorConfiguration), __ctx1__.__responseManager.GetEndpointBehaviorConfiguration(CreateMessageWrapperForUserCode(__ctx1__.__requestMessage)));
                    OneWayResponsePort.SetPropertyValue(typeof(Microsoft.XLANGs.BaseTypes.Address), __ctx1__.__responseManager.GetReplyTo(CreateMessageWrapperForUserCode(__ctx1__.__requestMessage)));
                    OneWayResponsePort.SetPropertyValue(typeof(Microsoft.XLANGs.BaseTypes.TransportType), "WCF-Custom");

                    if (__ctx1__.__responseMessage != null)
                        __ctx1__.UnrefMessage(__ctx1__.__responseMessage);
                    __ctx1__.__responseMessage = __responseMessage;
                    __ctx1__.RefMessage(__ctx1__.__responseMessage);
                }
                __ctx1__.__responseMessage.ConstructionCompleteEvent(true);
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Construct);
                    __edata.Messages.Add(__ctx1__.__responseMessage);
                    Tracker.FireEvent(__eventLocations[25],__edata,_stateMgrs[2].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                if ( !PreProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[26],__eventData[9],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 9;
            case 9:
                if (!__ctx2__.PrepareToPendingCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 10;
            case 10:
                if ( !PreProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                OneWayResponsePort.SendMessage(0, __ctx1__.__responseMessage, null, null, __ctx2__, __seg__ , Microsoft.XLANGs.Core.ActivityFlags.NextActivityPersists );
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.OutgoingRqst) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.OutgoingRqst;
                goto case 11;
            case 11:
                if ( !PreProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Send);
                    __edata.Messages.Add(__ctx1__.__responseMessage);
                    __edata.PortName = @"OneWayResponsePort";
                    Tracker.FireEvent(__eventLocations[27],__edata,_stateMgrs[2].TrackDataStream );
                }
                if (__ctx1__ != null && __ctx1__.__responseMessage != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__responseMessage);
                    __ctx1__.__responseMessage = null;
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 12;
            case 12:
                if (!__ctx2__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 13 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 13;
            case 13:
                if ( !PreProgressInc( __seg__, __ctx__, 14 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx2__.OnCommit();
                goto case 14;
            case 14:
                __seg__.SegmentDone();
                _segments[1].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment3(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[3];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[3];
            ____scope39_3 __ctx3__ = (____scope39_3)_stateMgrs[3];
            ____scope38_2 __ctx2__ = (____scope38_2)_stateMgrs[2];
            __DynamicSendPortOrchestration_1 __ctx1__ = (__DynamicSendPortOrchestration_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[8],__eventData[3],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                __ctx1__.__logHelper.WriteLine("[DynamicSendPortOrchestration] Request message received from [{0}].", (System.String)__ctx1__.__requestMessage.GetPropertyValueThrows(typeof(WCF.To)));
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 3;
            case 3:
                if ( !PreProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[9],__eventData[4],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 4;
            case 4:
                __ctx1__.__stream = __ctx1__.__requestManager.ProcessRequestReturnStream(CreateMessageWrapperForUserCode(__ctx1__.__requestMessage));
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 5;
            case 5:
                __ctx1__.__logHelper.WriteLine("[DynamicSendPortOrchestration] Request message successfully processed.");
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                if (!__ctx3__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx3__.OnCommit();
                goto case 8;
            case 8:
                __seg__.SegmentDone();
                _segments[2].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment4(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[4];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[3];
            ____scope39_3 __ctx3__ = (____scope39_3)_stateMgrs[3];
            __DynamicSendPortOrchestration_1 __ctx1__ = (__DynamicSendPortOrchestration_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                OnBeginCatchHandler(3);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[11],__eventData[5],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[12],__eventData[3],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx1__.__logHelper.WriteLine("[DynamicSendPortOrchestration] Creating error response...");
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[13],__eventData[4],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx1__.__stream = __ctx1__.__logHelper.GenerateErrorStream(__ctx3__.__ex_0);
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                __ctx1__.__logHelper.WriteLine(System.String.Format("[DynamicSendPortOrchestration] {0}", __ctx3__.__ex_0.Message));
                if (__ctx3__ != null)
                    __ctx3__.__ex_0 = null;
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[16],__eventData[6],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                __ctx3__.__exv__ = null;
                OnEndCatchHandler(3, __seg__);
                __seg__.SegmentDone();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment5(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[5];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[3];
            ____scope39_3 __ctx3__ = (____scope39_3)_stateMgrs[3];
            __DynamicSendPortOrchestration_1 __ctx1__ = (__DynamicSendPortOrchestration_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                OnBeginCatchHandler(3);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[17],__eventData[5],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[18],__eventData[3],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx1__.__logHelper.WriteLine("[DynamicSendPortOrchestration] Creating error response...");
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[19],__eventData[4],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx1__.__stream = __ctx1__.__logHelper.GenerateErrorStream("General Exception.");
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                __ctx1__.__logHelper.WriteLine("[DynamicSendPortOrchestration] General Exception.");
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[22],__eventData[6],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                __ctx3__.__exv__ = null;
                OnEndCatchHandler(3, __seg__);
                __seg__.SegmentDone();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment6(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[6];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[2];
            ____scope38_2 __ctx2__ = (____scope38_2)_stateMgrs[2];
            __DynamicSendPortOrchestration_1 __ctx1__ = (__DynamicSendPortOrchestration_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                OnBeginCatchHandler(2);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[28],__eventData[5],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[29],__eventData[3],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx1__.__logHelper.WriteLine(System.String.Format("[DynamicSendPortOrchestration] {0}", __ctx2__.__ex_0.Message));
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[30],__eventData[4],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                System.Diagnostics.EventLog.WriteEntry("DynamicSendPortOrchestration", __ctx2__.__ex_0.Message, System.Diagnostics.EventLogEntryType.Error);
                if (__ctx2__ != null)
                    __ctx2__.__ex_0 = null;
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                if ( !PreProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[33],__eventData[6],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 7;
            case 7:
                __ctx2__.__exv__ = null;
                OnEndCatchHandler(2, __seg__);
                __seg__.SegmentDone();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment7(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[7];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[2];
            ____scope38_2 __ctx2__ = (____scope38_2)_stateMgrs[2];
            __DynamicSendPortOrchestration_1 __ctx1__ = (__DynamicSendPortOrchestration_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                OnBeginCatchHandler(2);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[34],__eventData[5],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[35],__eventData[3],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx1__.__logHelper.WriteLine("[DynamicSendPortOrchestration] General Exception.");
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[36],__eventData[4],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                System.Diagnostics.EventLog.WriteEntry("DynamicSendPortOrchestration", "General Exception.", System.Diagnostics.EventLogEntryType.Error);
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                if ( !PreProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[39],__eventData[6],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 7;
            case 7:
                __ctx2__.__exv__ = null;
                OnEndCatchHandler(2, __seg__);
                __seg__.SegmentDone();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }
    }

    [System.SerializableAttribute]
    sealed public class __Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest__ : Microsoft.XLANGs.Core.XSDPart
    {
        private static Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorRequest _schema = new Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorRequest();

        public __Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest__(Microsoft.XLANGs.Core.XMessage msg, string name, int index) : base(msg, name, index) { }

        
        #region part reflection support
        public static Microsoft.XLANGs.BaseTypes.SchemaBase PartSchema { get { return (Microsoft.XLANGs.BaseTypes.SchemaBase)_schema; } }
        #endregion // part reflection support
    }

    [Microsoft.XLANGs.BaseTypes.MessageTypeAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic,
        Microsoft.XLANGs.BaseTypes.EXLangSMessageInfo.eThirdKind,
        "Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorRequest",
        new System.Type[]{
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorRequest)
        },
        new string[]{
            "part"
        },
        new System.Type[]{
            typeof(__Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest__)
        },
        0,
        @"http://windowsazure.cat.microsoft.com/samples/servicebusforwindowsserver#CalculatorRequest"
    )]
    [System.SerializableAttribute]
    sealed public class __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest : Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage
    {
        public __Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest__ part;

        private void __CreatePartWrappers()
        {
            part = new __Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest__(this, "part", 0);
            this.AddPart("part", 0, part);
        }

        public __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorRequest(string msgName, Microsoft.XLANGs.Core.Context ctx) : base(msgName, ctx)
        {
            __CreatePartWrappers();
        }
    }

    [System.SerializableAttribute]
    sealed public class __Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse__ : Microsoft.XLANGs.Core.XSDPart
    {
        private static Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse _schema = new Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse();

        public __Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse__(Microsoft.XLANGs.Core.XMessage msg, string name, int index) : base(msg, name, index) { }

        
        #region part reflection support
        public static Microsoft.XLANGs.BaseTypes.SchemaBase PartSchema { get { return (Microsoft.XLANGs.BaseTypes.SchemaBase)_schema; } }
        #endregion // part reflection support
    }

    [Microsoft.XLANGs.BaseTypes.MessageTypeAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic,
        Microsoft.XLANGs.BaseTypes.EXLangSMessageInfo.eThirdKind,
        "Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse",
        new System.Type[]{
            typeof(Microsoft.WindowsAzure.CAT.Samples.ServiceBusForWindowsServer.Schemas.CalculatorResponse)
        },
        new string[]{
            "part"
        },
        new System.Type[]{
            typeof(__Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse__)
        },
        0,
        @"http://windowsazure.cat.microsoft.com/samples/servicebusforwindowsserver#CalculatorResponse"
    )]
    [System.SerializableAttribute]
    sealed public class __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse : Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage
    {
        public __Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse__ part;

        private void __CreatePartWrappers()
        {
            part = new __Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse__(this, "part", 0);
            this.AddPart("part", 0, part);
        }

        public __messagetype_Microsoft_WindowsAzure_CAT_Samples_ServiceBusForWindowsServer_Schemas_CalculatorResponse(string msgName, Microsoft.XLANGs.Core.Context ctx) : base(msgName, ctx)
        {
            __CreatePartWrappers();
        }
    }

    [Microsoft.XLANGs.BaseTypes.BPELExportableAttribute(false)]
    sealed public class _MODULE_PROXY_ { }
}