Thursday, April 06, 2006

Biztalk - Adding a ReceiveLocation

the following code show how to create a ReceivePort and its corresponding receive Location using Microsoft.BizTalk.ExplorerOM:

private void CreateReceivePort(BtsCatalogExplorer catalog)
{
   Application app = catalog.Applications["FirstIntegration"];

   ReceivePort port = app.AddNewReceivePort(false);
   port.Name = "TestReceiveport";

   port.PrimaryReceiveLocation = port.AddNewReceiveLocation();
   port.PrimaryReceiveLocation.Name = "FileReceive";
   port.PrimaryReceiveLocation.TransportType = catalog.ProtocolTypes["FILE"];
   port.PrimaryReceiveLocation.ReceiveHandler = catalog.ReceiveHandlers[0];
   port.PrimaryReceiveLocation.Address = @"c:\infiles\*.xml";
   port.PrimaryReceiveLocation.ReceivePipeline = catalog.Pipelines["Microsoft.BizTalk.DefaultPipelines.XMLReceive"];

   catalog.SaveChanges();
}

remember to add Microsoft.BizTalk.ExplorerOM reference located under the developer tools folder of your biztalk folder and System.Management, if you want an easy way to get the connection string use Carlos Medina's Get the connection string to BizTalkMgmtDb

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home