示例#1
0
        public void BindOrchestration()
        {
            // Create the root object and set the connection string
            BtsCatalogExplorer catalog = new BtsCatalogExplorer();

            catalog.ConnectionString = "SERVER=.;DATABASE=BizTalkMgmtDb;Integrated Security=SSPI";

            try
            {
                BtsOrchestrationCollection orchestrations = catalog.Assemblies["HelloWorld"].Orchestrations;

                // Specify either a sendport or a sendportgroup for the orchestration outbound port
                orchestrations["Microsoft.Samples.BizTalk.HelloWorld.HelloSchedule"].Ports["SendInvoicePort"].SendPort = catalog.SendPorts["HelloWorldSendPort"];

                // Not using SendPortGroup for HelloWorld Sample *** //
                //orchestrations["Microsoft.Samples.BizTalk.HelloWorld.HelloSchedule"].Ports["SendInvoicePort"].SendPortGroup = catalog.SendPortGroups["SendPortGroup_1"];

                // Specify a receiveport for orchestration inbound port
                orchestrations["Microsoft.Samples.BizTalk.HelloWorld.HelloSchedule"].Ports["ReceivePOPort"].ReceivePort = catalog.ReceivePorts["HelloWorldReceivePort"];

                // Specify a host by index or name.
                orchestrations["Microsoft.Samples.BizTalk.HelloWorld.HelloSchedule"].Host = catalog.Hosts["BizTalkServerApplication"];

                // Commit the changes
                catalog.SaveChanges();
            }
            catch (Exception e)
            {
                catalog.DiscardChanges();
                throw e;
            }
        }
示例#2
0
        public void UnbindOrchestration()
        {
            // Create the root object and set the connection string
            BtsCatalogExplorer catalog = new BtsCatalogExplorer();

            catalog.ConnectionString = "SERVER=.;DATABASE=BizTalkMgmtDb;Integrated Security=SSPI";

            try
            {
                BtsOrchestrationCollection orchestrations = catalog.Assemblies["HelloWorld"].Orchestrations;

                // Reset the bindings
                orchestrations["Microsoft.Samples.BizTalk.HelloWorld.HelloSchedule"].Ports["SendInvoicePort"].SendPort = null;
                // Not using SendPortGroup for HelloWorld Sample *** //
                //orchestrations["Microsoft.Samples.BizTalk.HelloWorld.HelloSchedule"].Ports["SendInvoicePort"].SendPortGroup = null;
                orchestrations["Microsoft.Samples.BizTalk.HelloWorld.HelloSchedule"].Ports["ReceivePOPort"].ReceivePort = null;
                orchestrations["Microsoft.Samples.BizTalk.HelloWorld.HelloSchedule"].Host = null;

                // Commit the changes
                catalog.SaveChanges();
            }
            catch (Exception e)
            {
                catalog.DiscardChanges();
                throw e;
            }
        }
 public OrchestrationCollection(BtsOrchestrationCollection orchestrations)
 {
     if (orchestrations == null)
     {
         throw new ArgumentNullException("orchestrations");
     }
     BizTalkOrchestrationCollection = orchestrations;
 }
示例#4
0
        public void UnenlistOrchestration()
        {
            // Create the root object and set the connection string
            BtsCatalogExplorer catalog = new BtsCatalogExplorer();

            catalog.ConnectionString = "SERVER=.;DATABASE=BizTalkMgmtDb;Integrated Security=SSPI";

            try
            {
                BtsOrchestrationCollection orchestrations = catalog.Assemblies["HelloWorld"].Orchestrations;
                // Set the orchestration status to Unenlisted
                orchestrations["Microsoft.Samples.BizTalk.HelloWorld.HelloSchedule"].Status = OrchestrationStatus.Unenlisted;
                // Commit the changes
                catalog.SaveChanges();
            }
            catch (Exception e)
            {
                catalog.DiscardChanges();
                throw e;
            }
        }
示例#5
0
 public OrchestrationCollection(BtsOrchestrationCollection orchestrations)
 {
     BizTalkOrchestrationCollection = orchestrations ?? throw new ArgumentNullException(nameof(orchestrations));
 }