/// <summary>
        ///
        /// </summary>
        /// <param name="explorer"></param>
        /// <param name="port"></param>
        internal void Load(BizTalkCore.BtsCatalogExplorer explorer, BizTalkCore.SendPort port)
        {
            if (port != null)
            {
                this.QualifiedName = String.Empty;
                // Basic properties
                this.trackingType         = (TrackingType)Enum.Parse(typeof(TrackingType), ((int)port.Tracking).ToString());
                this.priority             = port.Priority;
                this.twoWay               = port.IsTwoWay;
                this.dynamic              = port.IsDynamic;
                this.sendPipeline         = port.SendPipeline.FullName;
                this.ApplicationName      = port.Application.Name;
                this.RouteFailedMessage   = port.RouteFailedMessage;
                this.StopSendingOnFailure = port.StopSendingOnFailure;
                this.CustomDescription    = port.Description;

                // Encryption Certificates
                if (port.EncryptionCert != null)
                {
                    this.encryptionCert = new EncryptionCert(port.EncryptionCert);
                }

                // Receive pipeline if two way
                if (this.twoWay)
                {
                    this.receivePipeline = port.ReceivePipeline.FullName;
                }

                // Primary transport
                if (port.PrimaryTransport != null)
                {
                    this.primaryTransport = new TransportInfo(port.PrimaryTransport, true);
                }

                // Secondary transport
                if (port.SecondaryTransport != null && port.SecondaryTransport.Address.Length > 0)
                {
                    this.secondaryTransport = new TransportInfo(port.SecondaryTransport, false);
                }

                // Filters
                if (port.Filter != string.Empty)
                {
                    this.FilterGroups = BizTalkInstallation.CreateFilterGroups(port.Filter);
                }
            }
        }
Beispiel #2
0
        internal void Load(BizTalkCore.BtsCatalogExplorer explorer, BizTalkCore.Party party)
        {
            if (party != null)
            {
                this.QualifiedName = String.Empty;
                this.aliases.Clear();
                this.sendPorts.Clear();

                this.Data          = party.CustomData;
                this.signatureCert = new EncryptionCert(party.SignatureCert);

                if (party.Aliases != null)
                {
                    foreach (BizTalkCore.PartyAlias alias in party.Aliases)
                    {
                        Alias a = new Alias();
                        // 2015/1/1 MTB Added try catch to handle exceptions bubbled up from  BizTalk object model
                        try
                        {
                            a.Name = alias.Name;
                        }
                        catch (InvalidCastException e)
                        {
                            a.Name = "Not Valued";
                        }

                        a.IsAutoCreated = alias.IsAutoCreated;
                        a.Qualifier     = alias.Qualifier;
                        a.Value         = alias.Value;
                        a.QualifiedName = a.Name + "_" + a.Qualifier + "_" + a.Value;
                        this.aliases.Add(a);
                    }
                }

                if (party.SendPorts != null)
                {
                    foreach (BizTalkCore.SendPort sp in party.SendPorts)
                    {
                        this.sendPorts.Add(new NameIdPair(sp.Name, ""));
                    }
                }
            }

            return;
        }
Beispiel #3
0
        internal void Load(BizTalkCore.BtsCatalogExplorer explorer, BizTalkCore.Party party)
        {
            if (party != null)
            {
                this.QualifiedName = String.Empty;
                this.aliases.Clear();
                this.sendPorts.Clear();

                this.Data          = party.CustomData;
                this.signatureCert = new EncryptionCert(party.SignatureCert);

                if (party.Aliases != null)
                {
                    foreach (BizTalkCore.PartyAlias alias in party.Aliases)
                    {
                        Alias a = new Alias();
                        a.Name = alias.Name;

                        a.IsAutoCreated = alias.IsAutoCreated;
                        a.Qualifier     = alias.Qualifier;
                        a.Value         = alias.Value;
                        a.QualifiedName = a.Name + "_" + a.Qualifier + "_" + a.Value;
                        this.aliases.Add(a);
                    }
                }

                if (party.SendPorts != null)
                {
                    foreach (BizTalkCore.SendPort sp in party.SendPorts)
                    {
                        this.sendPorts.Add(new NameIdPair(sp.Name, ""));
                    }
                }
            }

            return;
        }
        //public NameIdPair SendHandler
        //{
        //    get { return this.sendHandler; }
        //    set { this.sendHandler = value; }
        //}

        #endregion

        #region Load

        /// <summary>
        ///
        /// </summary>
        /// <param name="explorer"></param>
        /// <param name="port"></param>
        internal void Load(BizTalkCore.BtsCatalogExplorer explorer, BizTalkCore.SendPort port)
        {
            if (port != null)
            {
                this.QualifiedName = String.Empty;
                // Basic properties
                this.trackingType = (TrackingType)Enum.Parse(typeof(TrackingType), ((int)port.Tracking).ToString());
                this.priority     = port.Priority;
                this.twoWay       = port.IsTwoWay;
                this.dynamic      = port.IsDynamic;
                //this.sendPipeline = port.SendPipeline.FullName;

                // Fix so to have link for Send Pipeline  CD 20140404
                Pipeline pl = this.Application.ParentInstallation.Pipelines[port.SendPipeline.FullName] as Pipeline;
                if (pl != null)
                {
                    if (pl.Name == port.SendPipeline.FullName)  // Actually check that a match was found.
                    {
                        this.sendPipeline = pl.NameIdPair;
                    }
                    else
                    {
                        this.sendPipeline = new NameIdPair(port.SendPipeline.FullName, "");
                    }
                }

                this.ApplicationName      = port.Application.Name;
                this.RouteFailedMessage   = port.RouteFailedMessage;
                this.StopSendingOnFailure = port.StopSendingOnFailure;
                this.CustomDescription    = port.Description;

                // Encryption Certificates
                if (port.EncryptionCert != null)
                {
                    this.encryptionCert = new EncryptionCert(port.EncryptionCert);
                }

                // Receive pipeline if two way
                if (this.twoWay)
                {
                    //this.receivePipeline = port.ReceivePipeline.FullName; CD 20140405
                    Pipeline rpl = this.Application.ParentInstallation.Pipelines[port.ReceivePipeline.FullName] as Pipeline;
                    if (rpl != null)
                    {
                        if (rpl.Name == port.ReceivePipeline.FullName)  // Actually check that a match was found.
                        {
                            this.ReceivePipeline = rpl.NameIdPair;
                        }
                        else
                        {
                            this.ReceivePipeline = new NameIdPair(port.ReceivePipeline.FullName, "");
                        }
                    }
                }

                // Primary transport
                if (port.PrimaryTransport != null)
                {
                    this.primaryTransport = new TransportInfo(port.PrimaryTransport, true);
                }

                // Secondary transport
                if (port.SecondaryTransport != null && port.SecondaryTransport.Address.Length > 0)
                {
                    this.secondaryTransport = new TransportInfo(port.SecondaryTransport, false);
                }

                // Filters
                if (port.Filter != string.Empty)
                {
                    this.FilterGroups = BizTalkInstallation.CreateFilterGroups(port.Filter);
                }
            }
        }