Click here to Skip to main content
15,897,704 members
Articles / Productivity Apps and Services / Biztalk

Unleashing the Power of BizTalk Multipart Messages in BizTalk Server 2006/2006 R2/2009/2010

Rate me:
Please Sign up or sign in to vote.
4.73/5 (9 votes)
22 Oct 2010CPOL6 min read 77K   751   9  
This article explains how and when to use Multipart Messages in BizTalk
#pragma warning disable 162

namespace ProcessMultipart
{

    [System.SerializableAttribute]
    sealed public class __MultipartSchemas_PurchaseOrder__ : Microsoft.XLANGs.Core.XSDPart
    {
        private static MultipartSchemas.PurchaseOrder _schema = new MultipartSchemas.PurchaseOrder();

        public __MultipartSchemas_PurchaseOrder__(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
    }

    [System.SerializableAttribute]
    sealed public class __MultipartSchemas_RoutingInfo__ : Microsoft.XLANGs.Core.XSDPart
    {
        private static MultipartSchemas.RoutingInfo _schema = new MultipartSchemas.RoutingInfo();

        public __MultipartSchemas_RoutingInfo__(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.eNone,
        "",
        new System.Type[]{
            typeof(MultipartSchemas.PurchaseOrder),
            typeof(MultipartSchemas.RoutingInfo)
        },
        new string[]{
            "Body_PO",
            "Header_RoutingInfo"
        },
        new System.Type[]{
            typeof(__MultipartSchemas_PurchaseOrder__),
            typeof(__MultipartSchemas_RoutingInfo__)
        },
        0,
        @"http://MultipartSchemas.PurchaseOrder#PO"
    )]
    [System.SerializableAttribute]
    sealed public class SoapEnvelope : Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage
    {
        public __MultipartSchemas_PurchaseOrder__ Body_PO;
        public __MultipartSchemas_RoutingInfo__ Header_RoutingInfo;

        private void __CreatePartWrappers()
        {
            Body_PO = new __MultipartSchemas_PurchaseOrder__(this, "Body_PO", 0);
            this.AddPart("Body_PO", 0, Body_PO);
            Header_RoutingInfo = new __MultipartSchemas_RoutingInfo__(this, "Header_RoutingInfo", 1);
            this.AddPart("Header_RoutingInfo", 1, Header_RoutingInfo);
        }

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

    [Microsoft.XLANGs.BaseTypes.PortTypeOperationAttribute(
        "Direct",
        new System.Type[]{
            typeof(ProcessMultipart.SoapEnvelope)
        },
        new string[]{
        }
    )]
    [Microsoft.XLANGs.BaseTypes.PortTypeAttribute(Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal, "")]
    [System.SerializableAttribute]
    sealed internal class POEnvPortType2 : Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase
    {
        public POEnvPortType2(int portInfo, Microsoft.XLANGs.Core.IServiceProxy s)
            : base(portInfo, s)
        { }
        public POEnvPortType2(POEnvPortType2 p)
            : base(p)
        { }

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

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

    [Microsoft.XLANGs.BaseTypes.MessageTypeAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic,
        Microsoft.XLANGs.BaseTypes.EXLangSMessageInfo.eThirdKind,
        "MultipartSchemas.PurchaseOrder",
        new System.Type[]{
            typeof(MultipartSchemas.PurchaseOrder)
        },
        new string[]{
            "part"
        },
        new System.Type[]{
            typeof(__MultipartSchemas_PurchaseOrder__)
        },
        0,
        @"http://MultipartSchemas.PurchaseOrder#PO"
    )]
    [System.SerializableAttribute]
    sealed public class __messagetype_MultipartSchemas_PurchaseOrder : Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage
    {
        public __MultipartSchemas_PurchaseOrder__ part;

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

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

    [Microsoft.XLANGs.BaseTypes.PortTypeOperationAttribute(
        "ProcessPO",
        new System.Type[]{
            typeof(ProcessMultipart.__messagetype_MultipartSchemas_PurchaseOrder), 
            typeof(ProcessMultipart.__messagetype_MultipartSchemas_PurchaseOrder)
        },
        new string[]{
        }
    )]
    [Microsoft.XLANGs.BaseTypes.PortTypeAttribute(Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic, "")]
    [System.SerializableAttribute]
    sealed public class POPortType : Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase
    {
        public POPortType(int portInfo, Microsoft.XLANGs.Core.IServiceProxy s)
            : base(portInfo, s)
        { }
        public POPortType(POPortType p)
            : base(p)
        { }

        public override Microsoft.XLANGs.Core.PortBase Clone()
        {
            POPortType p = new POPortType(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 ProcessPO = new Microsoft.XLANGs.Core.OperationInfo
        (
            "ProcessPO",
            System.Web.Services.Description.OperationFlow.RequestResponse,
            typeof(POPortType),
            typeof(__messagetype_MultipartSchemas_PurchaseOrder),
            typeof(__messagetype_MultipartSchemas_PurchaseOrder),
            new System.Type[]{},
            new string[]{}
        );
        static public System.Collections.Hashtable OperationsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[ "ProcessPO" ] = ProcessPO;
                return h;
            }
        }
        #endregion // port reflection support
    }

    [Microsoft.XLANGs.BaseTypes.PortTypeOperationAttribute(
        "Direct",
        new System.Type[]{
            typeof(ProcessMultipart.SoapEnvelope)
        },
        new string[]{
        }
    )]
    [Microsoft.XLANGs.BaseTypes.PortTypeAttribute(Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal, "")]
    [System.SerializableAttribute]
    sealed internal class POEnvPortType : Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase
    {
        public POEnvPortType(int portInfo, Microsoft.XLANGs.Core.IServiceProxy s)
            : base(portInfo, s)
        { }
        public POEnvPortType(POEnvPortType p)
            : base(p)
        { }

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

        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal;
        #region port reflection support
        static public Microsoft.XLANGs.Core.OperationInfo Direct = new Microsoft.XLANGs.Core.OperationInfo
        (
            "Direct",
            System.Web.Services.Description.OperationFlow.OneWay,
            typeof(POEnvPortType),
            typeof(SoapEnvelope),
            null,
            new System.Type[]{},
            new string[]{}
        );
        static public System.Collections.Hashtable OperationsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[ "Direct" ] = Direct;
                return h;
            }
        }
        #endregion // port reflection support
    }
    //#line 114 "C:\BizTalkProjects\MultipartMessages\ProcessMultipart\POEnvelopeConsumer.odx"
    [Microsoft.XLANGs.BaseTypes.StaticSubscriptionAttribute(
        0, "ReceivePOEnv", "Direct", -1, -1, true
    )]
    [Microsoft.XLANGs.BaseTypes.ServicePortsAttribute(
        new Microsoft.XLANGs.BaseTypes.EXLangSParameter[] {
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.ePort|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements
        },
        new System.Type[] {
            typeof(ProcessMultipart.POEnvPortType2)
        },
        new System.String[] {
            "ReceivePOEnv"
        },
        new System.Type[] {
            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 POEnvelopeConsumer : 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(POEnvelopeConsumer));
        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 POEnvelopeConsumer()
        {
            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)
            };

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

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

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

        private const string _symInfo = @"
<XsymFile>
<ProcessFlow xmlns:om='http://schemas.microsoft.com/BizTalk/2003/DesignerData'>      <shapeType>RootShape</shapeType>      <ShapeID>fbaf799c-045e-485c-9fc9-0367d1cbaad0</ShapeID>      
<children>                          
<ShapeInfo>      <shapeType>ReceiveShape</shapeType>      <ShapeID>c15f0a29-79c4-40e7-b1e7-c394ab8cd346</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>Receive PO env</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>TaskShape</shapeType>      <ShapeID>17acfeba-a931-4e02-85b4-56651c593c2d</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>Use this PO envelope for further processing</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>1e78ce68-e0e8-400f-8812-21078d4d1065</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>Trace</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ProcessFlow>
<Metadata>

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

<TrkMetadata>
<Line>124</Line><Position>22</Position><ShapeID>'c15f0a29-79c4-40e7-b1e7-c394ab8cd346'</ShapeID>
<Messages>
	<MsgInfo><name>POEnv</name><part>Body_PO</part><schema>MultipartSchemas.PurchaseOrder</schema><direction>Out</direction></MsgInfo>
	<MsgInfo><name>POEnv</name><part>Header_RoutingInfo</part><schema>MultipartSchemas.RoutingInfo</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>128</Line><Position>25</Position><ShapeID>'1e78ce68-e0e8-400f-8812-21078d4d1065'</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='f9bb7019-5946-4188-aa55-b423732c0efb' LowerBound='1.1' HigherBound='38.1'>
        <om:Property Name='ReportToAnalyst' Value='True' />
        <om:Property Name='Name' Value='ProcessMultipart' />
        <om:Property Name='Signal' Value='False' />
        <om:Element Type='PortType' OID='39315acc-f147-476f-a3ff-f16845ddedf1' ParentLink='Module_PortType' LowerBound='4.1' HigherBound='11.1'>
            <om:Property Name='Synchronous' Value='False' />
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='POEnvPortType2' />
            <om:Property Name='Signal' Value='False' />
            <om:Element Type='OperationDeclaration' OID='8c869e52-42d2-430f-9da6-36f63198577a' 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='Direct' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='MessageRef' OID='d1bc9b76-79fa-49e8-a279-02d2c32811e3' ParentLink='OperationDeclaration_RequestMessageRef' LowerBound='8.13' HigherBound='8.25'>
                    <om:Property Name='Ref' Value='ProcessMultipart.SoapEnvelope' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Request' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
        </om:Element>
        <om:Element Type='ServiceDeclaration' OID='026033c8-1120-4fe7-aed0-c144914964ad' ParentLink='Module_ServiceDeclaration' LowerBound='11.1' HigherBound='37.1'>
            <om:Property Name='InitializedTransactionType' Value='False' />
            <om:Property Name='IsInvokable' Value='False' />
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='POEnvelopeConsumer' />
            <om:Property Name='Signal' Value='False' />
            <om:Element Type='VariableDeclaration' OID='62c46f50-9377-48b9-ac8c-61c7c071adfb' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='17.1' HigherBound='18.1'>
                <om:Property Name='UseDefaultConstructor' Value='True' />
                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='routingInfo' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='a48a5790-7b47-4a26-b41f-b4b94ef686d9' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='18.1' HigherBound='19.1'>
                <om:Property Name='UseDefaultConstructor' Value='True' />
                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='po' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='7d37a7ab-238b-4ff8-bd68-ad411664e4c2' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='16.1' HigherBound='17.1'>
                <om:Property Name='Type' Value='ProcessMultipart.SoapEnvelope' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='POEnv' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='ServiceBody' OID='fbaf799c-045e-485c-9fc9-0367d1cbaad0' ParentLink='ServiceDeclaration_ServiceBody'>
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='Receive' OID='c15f0a29-79c4-40e7-b1e7-c394ab8cd346' ParentLink='ServiceBody_Statement' LowerBound='21.1' HigherBound='25.1'>
                    <om:Property Name='Activate' Value='True' />
                    <om:Property Name='PortName' Value='ReceivePOEnv' />
                    <om:Property Name='MessageName' Value='POEnv' />
                    <om:Property Name='OperationName' Value='Direct' />
                    <om:Property Name='OperationMessageName' Value='Request' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Receive PO env' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
                <om:Element Type='Task' OID='17acfeba-a931-4e02-85b4-56651c593c2d' ParentLink='ServiceBody_Statement' LowerBound='25.1' HigherBound='35.1'>
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Use this PO envelope for further processing' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='VariableAssignment' OID='1e78ce68-e0e8-400f-8812-21078d4d1065' ParentLink='ComplexStatement_Statement' LowerBound='25.1' HigherBound='35.1'>
                        <om:Property Name='Expression' Value='routingInfo = POEnv.Header_RoutingInfo;&#xD;&#xA;po = POEnv.Body_PO;&#xD;&#xA;&#xD;&#xA;// Extract Routing Info&#xD;&#xA;System.Diagnostics.EventLog.WriteEntry(&quot;Routing Info&quot;, routingInfo.OuterXml);&#xD;&#xA;&#xD;&#xA;// Extract PO Info&#xD;&#xA;System.Diagnostics.EventLog.WriteEntry(&quot;PO Info&quot;, po.OuterXml);&#xD;&#xA;&#xD;&#xA;' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='Trace' />
                        <om:Property Name='Signal' Value='False' />
                    </om:Element>
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='f5e734aa-dd64-4ff9-8807-1a6ae899e578' 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='-1' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='ProcessMultipart.POEnvPortType2' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='ReceivePOEnv' />
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='DirectBindingAttribute' OID='392e7ea8-7490-4dba-8c78-2d3341c66344' 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>
    </om:Element>
</om:MetaModel>
";

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

            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()
            {
                POEnvelopeConsumer __svc__ = (POEnvelopeConsumer)_service;
                __POEnvelopeConsumer_root_0 __ctx0__ = (__POEnvelopeConsumer_root_0)(__svc__._stateMgrs[0]);

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

            internal Microsoft.XLANGs.Core.SubscriptionWrapper __subWrapper0;
        }


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

            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()
            {
                POEnvelopeConsumer __svc__ = (POEnvelopeConsumer)_service;
                __POEnvelopeConsumer_1 __ctx1__ = (__POEnvelopeConsumer_1)(__svc__._stateMgrs[1]);

                if (__ctx1__ != null)
                    __ctx1__.__routingInfo = null;
                if (__ctx1__ != null)
                    __ctx1__.__po = null;
                if (__ctx1__ != null && __ctx1__.__POEnv != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__POEnv);
                    __ctx1__.__POEnv = null;
                }
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("POEnv")]
            internal SoapEnvelope __POEnv;
            [Microsoft.XLANGs.Core.UserVariableAttribute("routingInfo")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __routingInfo;
            [Microsoft.XLANGs.Core.UserVariableAttribute("po")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __po;
        }

        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("ReceivePOEnv")]
        internal POEnvPortType2 ReceivePOEnv;

        public static Microsoft.XLANGs.Core.PortInfo[] _portInfo = new Microsoft.XLANGs.Core.PortInfo[] {
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {POEnvPortType2.Direct},
                                               typeof(POEnvelopeConsumer).GetField("ReceivePOEnv", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.implements,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(POEnvelopeConsumer), "ReceivePOEnv"),
                                               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];
                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, null , -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, "c15f0a29-79c4-40e7-b1e7-c394ab8cd346", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(2, "c15f0a29-79c4-40e7-b1e7-c394ab8cd346", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(3, "00000000-0000-0000-0000-000000000000", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(4, "1e78ce68-e0e8-400f-8812-21078d4d1065", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(5, "1e78ce68-e0e8-400f-8812-21078d4d1065", 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.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.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,4,4,5,5,5,5,3,3,3,3,};

        public static int[][] __progressLocations = new int[2] [] {__progressLocation0,__progressLocation1};
        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];
            __POEnvelopeConsumer_root_0 __ctx0__ = (__POEnvelopeConsumer_root_0)_stateMgrs[0];
            __POEnvelopeConsumer_1 __ctx1__ = (__POEnvelopeConsumer_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                ReceivePOEnv = new POEnvPortType2(0, this);
                __ctx__.PrologueCompleted = true;
                __ctx0__.__subWrapper0 = new Microsoft.XLANGs.Core.SubscriptionWrapper(ActivationSubGuids[0], ReceivePOEnv, 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 __POEnvelopeConsumer_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];
            __POEnvelopeConsumer_root_0 __ctx0__ = (__POEnvelopeConsumer_root_0)_stateMgrs[0];
            __POEnvelopeConsumer_1 __ctx1__ = (__POEnvelopeConsumer_1)_stateMgrs[1];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx1__.__routingInfo = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __ctx1__.__po = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __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 (!ReceivePOEnv.GetMessageId(__ctx0__.__subWrapper0.getSubscription(this), __seg__, __ctx1__, out __msgEnv__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if (__ctx1__.__POEnv != null)
                    __ctx1__.UnrefMessage(__ctx1__.__POEnv);
                __ctx1__.__POEnv = new SoapEnvelope("POEnv", __ctx1__);
                __ctx1__.RefMessage(__ctx1__.__POEnv);
                ReceivePOEnv.ReceiveMessage(0, __msgEnv__, __ctx1__.__POEnv, null, (Microsoft.XLANGs.Core.Context)_stateMgrs[1], __seg__);
                if (ReceivePOEnv != null)
                {
                    ReceivePOEnv.Close(__ctx1__, __seg__);
                    ReceivePOEnv = 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__.__POEnv);
                    __edata.PortName = @"ReceivePOEnv";
                    Tracker.FireEvent(__eventLocations[2],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx1__.__routingInfo.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                __ctx1__.__po.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                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[4],__eventData[2],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                __ctx1__.__routingInfo.UnderlyingXmlDocument = __ctx1__.__POEnv.Header_RoutingInfo.TypedValue;
                if ( !PostProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 9;
            case 9:
                if ( !PreProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[5],__eventData[3],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 10;
            case 10:
                __ctx1__.__po.UnderlyingXmlDocument = __ctx1__.__POEnv.Body_PO.TypedValue;
                if (__ctx1__ != null && __ctx1__.__POEnv != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__POEnv);
                    __ctx1__.__POEnv = null;
                }
                if ( !PostProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 11;
            case 11:
                System.Diagnostics.EventLog.WriteEntry("Routing Info", __ctx1__.__routingInfo.UnderlyingXmlDocument.OuterXml);
                if (__ctx1__ != null)
                    __ctx1__.__routingInfo = null;
                if ( !PostProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 12;
            case 12:
                System.Diagnostics.EventLog.WriteEntry("PO Info", __ctx1__.__po.UnderlyingXmlDocument.OuterXml);
                if (__ctx1__ != null)
                    __ctx1__.__po = null;
                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;
                Tracker.FireEvent(__eventLocations[3],__eventData[4],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 14;
            case 14:
                if (!__ctx1__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 15 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 15;
            case 15:
                if ( !PreProgressInc( __seg__, __ctx__, 16 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx1__.OnCommit();
                goto case 16;
            case 16:
                __seg__.SegmentDone();
                _segments[0].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }
    }
    //#line 279 "C:\BizTalkProjects\MultipartMessages\ProcessMultipart\PurchaseOrder.odx"
    [Microsoft.XLANGs.BaseTypes.StaticSubscriptionAttribute(
        0, "POPort", "ProcessPO", -1, -1, true
    )]
    [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
        },
        new System.Type[] {
            typeof(ProcessMultipart.POPortType),
            typeof(ProcessMultipart.POEnvPortType)
        },
        new System.String[] {
            "POPort",
            "POEnvPort"
        },
        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 PurchaseOrder : 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(PurchaseOrder));
        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 PurchaseOrder()
        {
            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)
            };

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

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

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

        private const string _symInfo = @"
<XsymFile>
<ProcessFlow xmlns:om='http://schemas.microsoft.com/BizTalk/2003/DesignerData'>      <shapeType>RootShape</shapeType>      <ShapeID>531f6697-e711-4628-8f99-77391465a7f6</ShapeID>      
<children>                          
<ShapeInfo>      <shapeType>ReceiveShape</shapeType>      <ShapeID>7290830a-d232-4b4a-aaa8-8c7eddb3db94</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>PO In</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>30530b3d-6ac3-485e-ad69-12f20c61fcda</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>SoapHeader</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ConstructShape</shapeType>      <ShapeID>67eadec3-efb4-44f1-b9f0-aaf676514c51</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>PORoutingInfo</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>MessageAssignmentShape</shapeType>      <ShapeID>eca6caeb-f517-4351-920a-5a9976cad87c</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>Create</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageRefShape</shapeType>      <ShapeID>859c9ea3-5c28-4203-bb13-a50c2ea45b02</ShapeID>      <ParentLink>Construct_MessageRef</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>TaskShape</shapeType>      <ShapeID>9c37d984-03fa-4fe6-adae-b92610d3ffd2</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>Creating the POEnv Multipart message</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ConstructShape</shapeType>      <ShapeID>65171d19-1f7e-4017-b30a-3ca186562d92</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>POEnv</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>MessageAssignmentShape</shapeType>      <ShapeID>ead1ffd2-f8d7-4a87-924c-d0d0ed904197</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>Create</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageRefShape</shapeType>      <ShapeID>495b71c5-3a61-46ea-b6fa-1bab015217b8</ShapeID>      <ParentLink>Construct_MessageRef</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>TaskShape</shapeType>      <ShapeID>ad89dd5e-2a01-4cef-8264-7be4ad6bb1d2</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>Send POEnv to MessageBox</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>SendShape</shapeType>      <ShapeID>294862fa-3077-4bd6-bcbe-f1ea4fe4eee9</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>Send POEnv</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ConstructShape</shapeType>      <ShapeID>ef8d60ff-a202-40f5-95f9-71cef642b06d</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>PO Out</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>MessageAssignmentShape</shapeType>      <ShapeID>bac6b9dc-ba36-4372-9777-3ca9f9e22ba3</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>Create</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageRefShape</shapeType>      <ShapeID>caeb64ca-9879-41b4-995e-1a2d3802df80</ShapeID>      <ParentLink>Construct_MessageRef</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>SendShape</shapeType>      <ShapeID>d0b140fb-40b6-45d3-a9de-43b820f1cf6f</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>PO Out</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ProcessFlow>
<Metadata>

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

<TrkMetadata>
<Line>294</Line><Position>22</Position><ShapeID>'7290830a-d232-4b4a-aaa8-8c7eddb3db94'</ShapeID>
<Messages>
	<MsgInfo><name>POIn</name><part>part</part><schema>MultipartSchemas.PurchaseOrder</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>298</Line><Position>24</Position><ShapeID>'30530b3d-6ac3-485e-ad69-12f20c61fcda'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>308</Line><Position>13</Position><ShapeID>'67eadec3-efb4-44f1-b9f0-aaf676514c51'</ShapeID>
<Messages>
	<MsgInfo><name>PORoutingInfo</name><part>part</part><schema>MultipartSchemas.RoutingInfo</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>318</Line><Position>13</Position><ShapeID>'65171d19-1f7e-4017-b30a-3ca186562d92'</ShapeID>
<Messages>
	<MsgInfo><name>POEnv</name><part>Body_PO</part><schema>MultipartSchemas.PurchaseOrder</schema><direction>Out</direction></MsgInfo>
	<MsgInfo><name>POEnv</name><part>Header_RoutingInfo</part><schema>MultipartSchemas.RoutingInfo</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>329</Line><Position>13</Position><ShapeID>'294862fa-3077-4bd6-bcbe-f1ea4fe4eee9'</ShapeID>
<Messages>
	<MsgInfo><name>POEnv</name><part>Body_PO</part><schema>MultipartSchemas.PurchaseOrder</schema><direction>Out</direction></MsgInfo>
	<MsgInfo><name>POEnv</name><part>Header_RoutingInfo</part><schema>MultipartSchemas.RoutingInfo</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>331</Line><Position>13</Position><ShapeID>'ef8d60ff-a202-40f5-95f9-71cef642b06d'</ShapeID>
<Messages>
	<MsgInfo><name>POOut</name><part>part</part><schema>MultipartSchemas.PurchaseOrder</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>343</Line><Position>13</Position><ShapeID>'d0b140fb-40b6-45d3-a9de-43b820f1cf6f'</ShapeID>
<Messages>
	<MsgInfo><name>POOut</name><part>part</part><schema>MultipartSchemas.PurchaseOrder</schema><direction>Out</direction></MsgInfo>
</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='1232d98a-0aca-469f-976b-39fcfb723964' LowerBound='1.1' HigherBound='92.1'>
        <om:Property Name='ReportToAnalyst' Value='True' />
        <om:Property Name='Name' Value='ProcessMultipart' />
        <om:Property Name='Signal' Value='False' />
        <om:Element Type='PortType' OID='8805931d-a38d-434b-b801-21895a9b9047' ParentLink='Module_PortType' LowerBound='9.1' HigherBound='16.1'>
            <om:Property Name='Synchronous' Value='True' />
            <om:Property Name='TypeModifier' Value='Public' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='POPortType' />
            <om:Property Name='Signal' Value='False' />
            <om:Element Type='OperationDeclaration' OID='37090586-b140-49c6-940a-d4a9a7051790' ParentLink='PortType_OperationDeclaration' LowerBound='11.1' HigherBound='15.1'>
                <om:Property Name='OperationType' Value='RequestResponse' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='ProcessPO' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='MessageRef' OID='a6adeff6-aeda-4618-bfbd-c47c6fa8d0fe' ParentLink='OperationDeclaration_RequestMessageRef' LowerBound='13.13' HigherBound='13.43'>
                    <om:Property Name='Ref' Value='MultipartSchemas.PurchaseOrder' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Request' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
                <om:Element Type='MessageRef' OID='81461401-16c8-497c-a288-c65cd0405e62' ParentLink='OperationDeclaration_ResponseMessageRef' LowerBound='13.45' HigherBound='13.75'>
                    <om:Property Name='Ref' Value='MultipartSchemas.PurchaseOrder' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Response' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
        </om:Element>
        <om:Element Type='PortType' OID='1f760b56-712e-46eb-b4b4-4fd16826ac97' ParentLink='Module_PortType' LowerBound='16.1' HigherBound='23.1'>
            <om:Property Name='Synchronous' Value='False' />
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='POEnvPortType' />
            <om:Property Name='Signal' Value='False' />
            <om:Element Type='OperationDeclaration' OID='28d2358d-6ee5-4af6-b120-aa1a6470469c' ParentLink='PortType_OperationDeclaration' LowerBound='18.1' HigherBound='22.1'>
                <om:Property Name='OperationType' Value='OneWay' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='Direct' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='MessageRef' OID='647881b0-1e44-4eaa-928e-9df7d2f8b497' ParentLink='OperationDeclaration_RequestMessageRef' LowerBound='20.13' HigherBound='20.25'>
                    <om:Property Name='Ref' Value='ProcessMultipart.SoapEnvelope' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='POEnv' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
            </om:Element>
        </om:Element>
        <om:Element Type='MultipartMessageType' OID='dda64df7-34eb-4e64-9b58-8a46fe33da76' ParentLink='Module_MessageType' LowerBound='4.1' HigherBound='9.1'>
            <om:Property Name='TypeModifier' Value='Public' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='SoapEnvelope' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='PartDeclaration' OID='c3a850c4-999b-4edc-9db3-7008361638de' ParentLink='MultipartMessageType_PartDeclaration' LowerBound='6.1' HigherBound='7.1'>
                <om:Property Name='ClassName' Value='MultipartSchemas.PurchaseOrder' />
                <om:Property Name='IsBodyPart' Value='True' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='Body_PO' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='PartDeclaration' OID='ec101a95-41d6-470f-add8-23af4af1ec3b' ParentLink='MultipartMessageType_PartDeclaration' LowerBound='7.1' HigherBound='8.1'>
                <om:Property Name='ClassName' Value='MultipartSchemas.RoutingInfo' />
                <om:Property Name='IsBodyPart' Value='False' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='Header_RoutingInfo' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
        </om:Element>
        <om:Element Type='ServiceDeclaration' OID='b47048bc-fdde-4a05-b50a-8ea5b3a02260' ParentLink='Module_ServiceDeclaration' LowerBound='23.1' HigherBound='91.1'>
            <om:Property Name='InitializedTransactionType' Value='False' />
            <om:Property Name='IsInvokable' Value='False' />
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='PurchaseOrder' />
            <om:Property Name='Signal' Value='False' />
            <om:Element Type='VariableDeclaration' OID='eef0a842-4ff6-482d-a990-6a8774c4c085' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='34.1' HigherBound='35.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.String' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='soapHeader' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='eea31454-ec5b-4c18-9482-9bdedcef5792' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='35.1' HigherBound='36.1'>
                <om:Property Name='UseDefaultConstructor' Value='True' />
                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='xmlDocument' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='b1921b58-57aa-4856-9efa-8f1a4ecb9870' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='30.1' HigherBound='31.1'>
                <om:Property Name='Type' Value='MultipartSchemas.PurchaseOrder' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='POIn' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='29201987-3a23-4676-ac44-accbb49696a4' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='31.1' HigherBound='32.1'>
                <om:Property Name='Type' Value='MultipartSchemas.PurchaseOrder' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='POOut' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='54e0fe2f-de0f-4ed7-a483-5d20e46299f6' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='32.1' HigherBound='33.1'>
                <om:Property Name='Type' Value='ProcessMultipart.SoapEnvelope' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='POEnv' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='e5c12348-9145-4b81-a7c9-2ff4d378039b' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='33.1' HigherBound='34.1'>
                <om:Property Name='Type' Value='MultipartSchemas.RoutingInfo' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='PORoutingInfo' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='ServiceBody' OID='531f6697-e711-4628-8f99-77391465a7f6' ParentLink='ServiceDeclaration_ServiceBody'>
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='Receive' OID='7290830a-d232-4b4a-aaa8-8c7eddb3db94' ParentLink='ServiceBody_Statement' LowerBound='38.1' HigherBound='42.1'>
                    <om:Property Name='Activate' Value='True' />
                    <om:Property Name='PortName' Value='POPort' />
                    <om:Property Name='MessageName' Value='POIn' />
                    <om:Property Name='OperationName' Value='ProcessPO' />
                    <om:Property Name='OperationMessageName' Value='Request' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='PO In' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
                <om:Element Type='VariableAssignment' OID='30530b3d-6ac3-485e-ad69-12f20c61fcda' ParentLink='ServiceBody_Statement' LowerBound='42.1' HigherBound='52.1'>
                    <om:Property Name='Expression' Value='soapHeader = POIn(WCF.InboundHeaders);&#xD;&#xA;System.Diagnostics.EventLog.WriteEntry(&quot;soapHeader&quot;, soapHeader);&#xD;&#xA;&#xD;&#xA;// strip off headers&#xD;&#xA;//xmlDocument = new System.Xml.XmlDocument();&#xD;&#xA;//xmlDocument.LoadXml(soapHeader);&#xD;&#xA;&#xD;&#xA;//soapHeader = xpath(POIn,&quot;string(//headers)&quot;);&#xD;&#xA;&#xD;&#xA;' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='SoapHeader' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
                <om:Element Type='Construct' OID='67eadec3-efb4-44f1-b9f0-aaf676514c51' ParentLink='ServiceBody_Statement' LowerBound='52.1' HigherBound='62.1'>
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='PORoutingInfo' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='MessageAssignment' OID='eca6caeb-f517-4351-920a-5a9976cad87c' ParentLink='ComplexStatement_Statement' LowerBound='55.1' HigherBound='61.1'>
                        <om:Property Name='Expression' Value='xmlDocument = new System.Xml.XmlDocument();&#xD;&#xA;xmlDocument.LoadXml(soapHeader);&#xD;&#xA;&#xD;&#xA;PORoutingInfo = xmlDocument;&#xD;&#xA;&#xD;&#xA;' />
                        <om:Property Name='ReportToAnalyst' Value='False' />
                        <om:Property Name='Name' Value='Create' />
                        <om:Property Name='Signal' Value='False' />
                    </om:Element>
                    <om:Element Type='MessageRef' OID='859c9ea3-5c28-4203-bb13-a50c2ea45b02' ParentLink='Construct_MessageRef' LowerBound='53.23' HigherBound='53.36'>
                        <om:Property Name='Ref' Value='PORoutingInfo' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Signal' Value='False' />
                    </om:Element>
                </om:Element>
                <om:Element Type='Task' OID='9c37d984-03fa-4fe6-adae-b92610d3ffd2' ParentLink='ServiceBody_Statement' LowerBound='62.1' HigherBound='73.1'>
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Creating the POEnv Multipart message' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='Construct' OID='65171d19-1f7e-4017-b30a-3ca186562d92' ParentLink='ComplexStatement_Statement' LowerBound='62.1' HigherBound='73.1'>
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='POEnv' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='MessageAssignment' OID='ead1ffd2-f8d7-4a87-924c-d0d0ed904197' ParentLink='ComplexStatement_Statement' LowerBound='65.1' HigherBound='72.1'>
                            <om:Property Name='Expression' Value='// Use this PO Envelope created for other processing and send it to message box.&#xD;&#xA;// Build another orchestration as a consumer of PO Envelope&#xD;&#xA;&#xD;&#xA;POEnv.Header_RoutingInfo = PORoutingInfo;&#xD;&#xA;POEnv.Body_PO = POIn;&#xD;&#xA;&#xD;&#xA;' />
                            <om:Property Name='ReportToAnalyst' Value='False' />
                            <om:Property Name='Name' Value='Create' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                        <om:Element Type='MessageRef' OID='495b71c5-3a61-46ea-b6fa-1bab015217b8' ParentLink='Construct_MessageRef' LowerBound='63.23' HigherBound='63.28'>
                            <om:Property Name='Ref' Value='POEnv' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                    </om:Element>
                </om:Element>
                <om:Element Type='Task' OID='ad89dd5e-2a01-4cef-8264-7be4ad6bb1d2' ParentLink='ServiceBody_Statement' LowerBound='73.1' HigherBound='75.1'>
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Send POEnv to MessageBox' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='Send' OID='294862fa-3077-4bd6-bcbe-f1ea4fe4eee9' ParentLink='ComplexStatement_Statement' LowerBound='73.1' HigherBound='75.1'>
                        <om:Property Name='PortName' Value='POEnvPort' />
                        <om:Property Name='MessageName' Value='POEnv' />
                        <om:Property Name='OperationName' Value='Direct' />
                        <om:Property Name='OperationMessageName' Value='POEnv' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='Send POEnv' />
                        <om:Property Name='Signal' Value='True' />
                    </om:Element>
                </om:Element>
                <om:Element Type='Construct' OID='ef8d60ff-a202-40f5-95f9-71cef642b06d' ParentLink='ServiceBody_Statement' LowerBound='75.1' HigherBound='87.1'>
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='PO Out' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='MessageAssignment' OID='bac6b9dc-ba36-4372-9777-3ca9f9e22ba3' ParentLink='ComplexStatement_Statement' LowerBound='78.1' HigherBound='86.1'>
                        <om:Property Name='Expression' Value='// Changing the PO status to Complete.&#xD;&#xA;POOut = POIn;&#xD;&#xA;POOut.POStatus = &quot;Complete&quot;;&#xD;&#xA;&#xD;&#xA;xmlDocument = PORoutingInfo;&#xD;&#xA;&#xD;&#xA;POOut(WCF.OutboundCustomHeaders) = &quot;&lt;headers&gt;&quot; + xmlDocument.OuterXml + &quot;&lt;/headers&gt;&quot;;' />
                        <om:Property Name='ReportToAnalyst' Value='False' />
                        <om:Property Name='Name' Value='Create' />
                        <om:Property Name='Signal' Value='False' />
                    </om:Element>
                    <om:Element Type='MessageRef' OID='caeb64ca-9879-41b4-995e-1a2d3802df80' ParentLink='Construct_MessageRef' LowerBound='76.23' HigherBound='76.28'>
                        <om:Property Name='Ref' Value='POOut' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Signal' Value='False' />
                    </om:Element>
                </om:Element>
                <om:Element Type='Send' OID='d0b140fb-40b6-45d3-a9de-43b820f1cf6f' ParentLink='ServiceBody_Statement' LowerBound='87.1' HigherBound='89.1'>
                    <om:Property Name='PortName' Value='POPort' />
                    <om:Property Name='MessageName' Value='POOut' />
                    <om:Property Name='OperationName' Value='ProcessPO' />
                    <om:Property Name='OperationMessageName' Value='Response' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='PO Out' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='329284f5-4422-48df-965e-1ee6f436e4c9' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='26.1' HigherBound='28.1'>
                <om:Property Name='PortModifier' Value='Uses' />
                <om:Property Name='Orientation' Value='Right' />
                <om:Property Name='PortIndex' Value='42' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='ProcessMultipart.POEnvPortType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='POEnvPort' />
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='DirectBindingAttribute' OID='f0ecacc3-a4f7-4990-bb61-a62e40994390' ParentLink='PortDeclaration_CLRAttribute' LowerBound='26.1' HigherBound='27.1'>
                    <om:Property Name='DirectBindingType' Value='MessageBox' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='73001b8f-6364-4a18-9798-7c395c69dd5d' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='28.1' HigherBound='30.1'>
                <om:Property Name='PortModifier' Value='Implements' />
                <om:Property Name='Orientation' Value='Left' />
                <om:Property Name='PortIndex' Value='29' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='ProcessMultipart.POPortType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='POPort' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='LogicalBindingAttribute' OID='de3c9d83-281a-4407-9168-d8526c285528' ParentLink='PortDeclaration_CLRAttribute' LowerBound='28.1' HigherBound='29.1'>
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
        </om:Element>
    </om:Element>
</om:MetaModel>
";

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

            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()
            {
                PurchaseOrder __svc__ = (PurchaseOrder)_service;
                __PurchaseOrder_root_0 __ctx0__ = (__PurchaseOrder_root_0)(__svc__._stateMgrs[0]);

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

            internal Microsoft.XLANGs.Core.SubscriptionWrapper __subWrapper0;
        }


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

            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()
            {
                PurchaseOrder __svc__ = (PurchaseOrder)_service;
                __PurchaseOrder_1 __ctx1__ = (__PurchaseOrder_1)(__svc__._stateMgrs[1]);

                if (__ctx1__ != null && __ctx1__.__POOut != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__POOut);
                    __ctx1__.__POOut = null;
                }
                if (__ctx1__ != null)
                    __ctx1__.__soapHeader = null;
                if (__ctx1__ != null && __ctx1__.__POIn != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__POIn);
                    __ctx1__.__POIn = null;
                }
                if (__ctx1__ != null && __ctx1__.__PORoutingInfo != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__PORoutingInfo);
                    __ctx1__.__PORoutingInfo = null;
                }
                if (__ctx1__ != null)
                    __ctx1__.__xmlDocument = null;
                if (__ctx1__ != null && __ctx1__.__POEnv != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__POEnv);
                    __ctx1__.__POEnv = null;
                }
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("POIn")]
            public __messagetype_MultipartSchemas_PurchaseOrder __POIn;
            [Microsoft.XLANGs.Core.UserVariableAttribute("POOut")]
            public __messagetype_MultipartSchemas_PurchaseOrder __POOut;
            [Microsoft.XLANGs.Core.UserVariableAttribute("POEnv")]
            internal SoapEnvelope __POEnv;
            [Microsoft.XLANGs.Core.UserVariableAttribute("PORoutingInfo")]
            public __messagetype_MultipartSchemas_RoutingInfo __PORoutingInfo;
            [Microsoft.XLANGs.Core.UserVariableAttribute("soapHeader")]
            internal System.String __soapHeader;
            [Microsoft.XLANGs.Core.UserVariableAttribute("xmlDocument")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __xmlDocument;
        }

        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.LogicalBindingAttribute()]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("POPort")]
        internal POPortType POPort;
        [Microsoft.XLANGs.BaseTypes.DirectBindingAttribute()]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eUses
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("POEnvPort")]
        internal POEnvPortType POEnvPort;

        public static Microsoft.XLANGs.Core.PortInfo[] _portInfo = new Microsoft.XLANGs.Core.PortInfo[] {
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {POPortType.ProcessPO},
                                               typeof(PurchaseOrder).GetField("POPort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.implements,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(PurchaseOrder), "POPort"),
                                               null),
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {POEnvPortType.Direct},
                                               typeof(PurchaseOrder).GetField("POEnvPort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.uses,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(PurchaseOrder), "POEnvPort"),
                                               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, null , -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, "7290830a-d232-4b4a-aaa8-8c7eddb3db94", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(2, "7290830a-d232-4b4a-aaa8-8c7eddb3db94", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(3, "00000000-0000-0000-0000-000000000000", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(4, "30530b3d-6ac3-485e-ad69-12f20c61fcda", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(5, "30530b3d-6ac3-485e-ad69-12f20c61fcda", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(6, "67eadec3-efb4-44f1-b9f0-aaf676514c51", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(7, "67eadec3-efb4-44f1-b9f0-aaf676514c51", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(8, "65171d19-1f7e-4017-b30a-3ca186562d92", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(9, "65171d19-1f7e-4017-b30a-3ca186562d92", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(10, "294862fa-3077-4bd6-bcbe-f1ea4fe4eee9", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(11, "294862fa-3077-4bd6-bcbe-f1ea4fe4eee9", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(12, "ef8d60ff-a202-40f5-95f9-71cef642b06d", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(13, "ef8d60ff-a202-40f5-95f9-71cef642b06d", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(14, "d0b140fb-40b6-45d3-a9de-43b820f1cf6f", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(15, "d0b140fb-40b6-45d3-a9de-43b820f1cf6f", 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.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.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,4,4,5,5,6,6,7,8,8,9,10,10,10,11,12,12,13,14,14,14,15,3,3,3,3,};

        public static int[][] __progressLocations = new int[2] [] {__progressLocation0,__progressLocation1};
        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];
            __PurchaseOrder_1 __ctx1__ = (__PurchaseOrder_1)_stateMgrs[1];
            __PurchaseOrder_root_0 __ctx0__ = (__PurchaseOrder_root_0)_stateMgrs[0];

            switch (__seg__.Progress)
            {
            case 0:
                POEnvPort = new POEnvPortType(1, this);
                POPort = new POPortType(0, this);
                __ctx__.PrologueCompleted = true;
                __ctx0__.__subWrapper0 = new Microsoft.XLANGs.Core.SubscriptionWrapper(ActivationSubGuids[0], POPort, 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 __PurchaseOrder_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];
            __PurchaseOrder_1 __ctx1__ = (__PurchaseOrder_1)_stateMgrs[1];
            __PurchaseOrder_root_0 __ctx0__ = (__PurchaseOrder_root_0)_stateMgrs[0];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx1__.__soapHeader = default(System.String);
                __ctx1__.__xmlDocument = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __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 (!POPort.GetMessageId(__ctx0__.__subWrapper0.getSubscription(this), __seg__, __ctx1__, out __msgEnv__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if (__ctx1__.__POIn != null)
                    __ctx1__.UnrefMessage(__ctx1__.__POIn);
                __ctx1__.__POIn = new __messagetype_MultipartSchemas_PurchaseOrder("POIn", __ctx1__);
                __ctx1__.RefMessage(__ctx1__.__POIn);
                POPort.ReceiveMessage(0, __msgEnv__, __ctx1__.__POIn, null, (Microsoft.XLANGs.Core.Context)_stateMgrs[1], __seg__);
                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__.__POIn);
                    __edata.PortName = @"POPort";
                    Tracker.FireEvent(__eventLocations[2],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx1__.__soapHeader = "";
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                __ctx1__.__xmlDocument.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                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[4],__eventData[2],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                __ctx1__.__soapHeader = (System.String)__ctx1__.__POIn.GetPropertyValueThrows(typeof(WCF.InboundHeaders));
                if ( !PostProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 9;
            case 9:
                if ( !PreProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[5],__eventData[3],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 10;
            case 10:
                System.Diagnostics.EventLog.WriteEntry("soapHeader", __ctx1__.__soapHeader);
                if ( !PostProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 11;
            case 11:
                if ( !PreProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[6],__eventData[4],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 12;
            case 12:
                {
                    __messagetype_MultipartSchemas_RoutingInfo __PORoutingInfo = new __messagetype_MultipartSchemas_RoutingInfo("PORoutingInfo", __ctx1__);

                    __ctx1__.__xmlDocument.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                    __ctx1__.__xmlDocument.UnderlyingXmlDocument.LoadXml(__ctx1__.__soapHeader);
                    if (__ctx1__ != null)
                        __ctx1__.__soapHeader = null;
                    __PORoutingInfo.part.LoadFrom((System.Xml.XmlDocument)__ctx1__.__xmlDocument.UnderlyingXmlDocument);

                    if (__ctx1__.__PORoutingInfo != null)
                        __ctx1__.UnrefMessage(__ctx1__.__PORoutingInfo);
                    __ctx1__.__PORoutingInfo = __PORoutingInfo;
                    __ctx1__.RefMessage(__ctx1__.__PORoutingInfo);
                }
                __ctx1__.__PORoutingInfo.ConstructionCompleteEvent(false);
                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;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Construct);
                    __edata.Messages.Add(__ctx1__.__PORoutingInfo);
                    Tracker.FireEvent(__eventLocations[7],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 14;
            case 14:
                if ( !PreProgressInc( __seg__, __ctx__, 15 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[8],__eventData[4],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 15;
            case 15:
                {
                    SoapEnvelope __POEnv = new SoapEnvelope("POEnv", __ctx1__);

                    __POEnv.Header_RoutingInfo.CopyFrom(__ctx1__.__PORoutingInfo.part);
                    __POEnv.Body_PO.CopyFrom(__ctx1__.__POIn.part);

                    if (__ctx1__.__POEnv != null)
                        __ctx1__.UnrefMessage(__ctx1__.__POEnv);
                    __ctx1__.__POEnv = __POEnv;
                    __ctx1__.RefMessage(__ctx1__.__POEnv);
                }
                __ctx1__.__POEnv.ConstructionCompleteEvent(false);
                if ( !PostProgressInc( __seg__, __ctx__, 16 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 16;
            case 16:
                if ( !PreProgressInc( __seg__, __ctx__, 17 ) )
                    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__.__POEnv);
                    Tracker.FireEvent(__eventLocations[9],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 17;
            case 17:
                if ( !PreProgressInc( __seg__, __ctx__, 18 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[10],__eventData[5],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 18;
            case 18:
                if (!__ctx1__.PrepareToPendingCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 19 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 19;
            case 19:
                if ( !PreProgressInc( __seg__, __ctx__, 20 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                POEnvPort.SendMessage(0, __ctx1__.__POEnv, null, null, __ctx1__, __seg__ , Microsoft.XLANGs.Core.ActivityFlags.None );
                if (POEnvPort != null)
                {
                    POEnvPort.Close(__ctx1__, __seg__);
                    POEnvPort = null;
                }
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.OutgoingRqst) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.OutgoingRqst;
                goto case 20;
            case 20:
                if ( !PreProgressInc( __seg__, __ctx__, 21 ) )
                    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__.__POEnv);
                    __edata.PortName = @"POEnvPort";
                    Tracker.FireEvent(__eventLocations[11],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (__ctx1__ != null && __ctx1__.__POEnv != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__POEnv);
                    __ctx1__.__POEnv = null;
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 21;
            case 21:
                if ( !PreProgressInc( __seg__, __ctx__, 22 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[12],__eventData[4],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 22;
            case 22:
                {
                    __messagetype_MultipartSchemas_PurchaseOrder __POOut = new __messagetype_MultipartSchemas_PurchaseOrder("POOut", __ctx1__);

                    __POOut.CopyFrom(__ctx1__.__POIn);
                    if (__ctx1__ != null && __ctx1__.__POIn != null)
                    {
                        __ctx1__.UnrefMessage(__ctx1__.__POIn);
                        __ctx1__.__POIn = null;
                    }
                    __POOut.part.SetDistinguishedField("POStatus", "Complete");
                    __ctx1__.__xmlDocument.UnderlyingXmlDocument = __ctx1__.__PORoutingInfo.part.TypedValue;
                    if (__ctx1__ != null && __ctx1__.__PORoutingInfo != null)
                    {
                        __ctx1__.UnrefMessage(__ctx1__.__PORoutingInfo);
                        __ctx1__.__PORoutingInfo = null;
                    }
                    __POOut.SetPropertyValue(typeof(WCF.OutboundCustomHeaders), "<headers>" + __ctx1__.__xmlDocument.UnderlyingXmlDocument.OuterXml + "</headers>");
                    if (__ctx1__ != null)
                        __ctx1__.__xmlDocument = null;

                    if (__ctx1__.__POOut != null)
                        __ctx1__.UnrefMessage(__ctx1__.__POOut);
                    __ctx1__.__POOut = __POOut;
                    __ctx1__.RefMessage(__ctx1__.__POOut);
                }
                __ctx1__.__POOut.ConstructionCompleteEvent(false);
                if ( !PostProgressInc( __seg__, __ctx__, 23 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 23;
            case 23:
                if ( !PreProgressInc( __seg__, __ctx__, 24 ) )
                    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__.__POOut);
                    Tracker.FireEvent(__eventLocations[13],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 24;
            case 24:
                if ( !PreProgressInc( __seg__, __ctx__, 25 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[14],__eventData[5],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 25;
            case 25:
                if (!__ctx1__.PrepareToPendingCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 26 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 26;
            case 26:
                if ( !PreProgressInc( __seg__, __ctx__, 27 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                POPort.SendMessage(0, __ctx1__.__POOut, null, null, __ctx1__, __seg__ , Microsoft.XLANGs.Core.ActivityFlags.NextActivityPersists );
                if (POPort != null)
                {
                    POPort.Close(__ctx1__, __seg__);
                    POPort = null;
                }
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.OutgoingResp) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.OutgoingResp;
                goto case 27;
            case 27:
                if ( !PreProgressInc( __seg__, __ctx__, 28 ) )
                    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__.__POOut);
                    __edata.PortName = @"POPort";
                    Tracker.FireEvent(__eventLocations[15],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (__ctx1__ != null && __ctx1__.__POOut != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__POOut);
                    __ctx1__.__POOut = null;
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 28;
            case 28:
                if ( !PreProgressInc( __seg__, __ctx__, 29 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[3],__eventData[6],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 29;
            case 29:
                if (!__ctx1__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 30 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 30;
            case 30:
                if ( !PreProgressInc( __seg__, __ctx__, 31 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx1__.OnCommit();
                goto case 31;
            case 31:
                __seg__.SegmentDone();
                _segments[0].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }
    }

    [Microsoft.XLANGs.BaseTypes.MessageTypeAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic,
        Microsoft.XLANGs.BaseTypes.EXLangSMessageInfo.eThirdKind,
        "MultipartSchemas.RoutingInfo",
        new System.Type[]{
            typeof(MultipartSchemas.RoutingInfo)
        },
        new string[]{
            "part"
        },
        new System.Type[]{
            typeof(__MultipartSchemas_RoutingInfo__)
        },
        0,
        @"http://MultipartSchemas.RoutingInfo#RoutingInfo"
    )]
    [System.SerializableAttribute]
    sealed public class __messagetype_MultipartSchemas_RoutingInfo : Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage
    {
        public __MultipartSchemas_RoutingInfo__ part;

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

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

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

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


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

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

Comments and Discussions