2009-10-04 5 views

답변

8

ExplorerOM 외에도 WMI를 사용하여 수신 위치를 활성화/비활성화하고 전송 포트를 제어 할 수 있습니다.

관심있는 경우 이러한 작업을 수행하는 방법을 보여주는 샘플 PowerShell 스크립트가 있습니다.

+0

위대한, 이것은 확실히 유효합니다. 더 많은 옵션이 더 좋습니다. 감사합니다 tomasr. –

2

해결책을 찾았습니다. Microsoft.BizTalk.ExplorerOM.dll이 내가 원하는 것 같습니다. 여기에 다른 사람을 얻어야한다는 BizTalk 문서에서 발췌 한이 시작됩니다 :

using System; 
using Microsoft.BizTalk.ExplorerOM; 
public static void EnumerateOrchestrationArtifacts() 
{ 
    // Connect to the local BizTalk Management database 
    BtsCatalogExplorer catalog = new BtsCatalogExplorer(); 
    catalog.ConnectionString = "Server=.;Initial Catalog=BizTalkMgmtDb;Integrated Security=SSPI;"; 

    // Enumerate all orchestrations and their ports/roles 
    Console.WriteLine("ORCHESTRATIONS: "); 
    foreach(BtsAssembly assembly in catalog.Assemblies) 
    { 
     foreach(BtsOrchestration orch in assembly.Orchestrations) 
     { 

      Console.WriteLine(" Name:{0}\r\n Host:{1}\r\n Status:{2}", 
       orch.FullName, orch.Host.Name, orch.Status); 

      // Enumerate ports and operations 
      foreach(OrchestrationPort port in orch.Ports) 
      { 
       Console.WriteLine("\t{0} ({1})", 
        port.Name, port.PortType.FullName); 

       foreach(PortTypeOperation operation in port.PortType.Operations) 
       { 
        Console.WriteLine("\t\t" + operation.Name); 
       } 
      } 

      // Enumerate used roles 
      foreach(Role role in orch.UsedRoles) 
      { 
       Console.WriteLine("\t{0} ({1})", 
        role.Name, role.ServiceLinkType); 

       foreach(EnlistedParty enlistedparty in role.EnlistedParties) 
       { 
        Console.WriteLine("\t\t" + enlistedparty.Party.Name); 
       } 
      } 

      // Enumerate implemented roles 
      foreach(Role role in orch.ImplementedRoles) 
      { 
       Console.WriteLine("\t{0} ({1})", 
        role.Name, role.ServiceLinkType); 
      } 
     } 
    } 
} 

하나주의, 분명히이 DLL은 64 비트를 지원하지 않습니다. 필자는 단순한 유틸리티를 작성하기 때문에 (32 비트로 컴파일하는 것만으로는) 큰 문제가 아니지만, 알고 있어야 할 것이 있습니다.

+0

내가 Biztalk Server에 원격 액세스를 사용할 수 있습니다 ?? – Kiquenet

+0

어이 Alhambraeidos, 만약 네가 올바르게 이해한다면 네가 할 수있어. 나는 수신 위치를 선택하고 끌 수있는 작은 윈도우 응용 프로그램을 만드는 데 이것을 사용했다. –

0

Alhambraeidos 코멘트에 응답.

/// <summary> 
    /// Gets or sets the biz talk catalog. 
    /// </summary> 
    /// <value>The biz talk catalog.</value> 
    private BtsCatalogExplorer BizTalkCatalog { get; set; } 

    /// <summary> 
    /// Initializes the biz talk artifacts. 
    /// </summary> 
    private void InitializeBizTalkCatalogExplorer() 
    { 
     // Connect to the local BizTalk Management database 
     BizTalkCatalog = new BtsCatalogExplorer(); 
     BizTalkCatalog.ConnectionString = "server=BiztalkDbServer;database=BizTalkMgmtDb;integrated security=true"; 
    } 


    /// <summary> 
    /// Gets the location from biz talk. 
    /// </summary> 
    /// <param name="locationName">Name of the location.</param> 
    /// <returns></returns> 
    private ReceiveLocation GetLocationFromBizTalk(string locationName) 
    { 
     ReceivePortCollection receivePorts = BizTalkCatalog.ReceivePorts; 
     foreach (ReceivePort port in receivePorts) 
     { 
      foreach (ReceiveLocation location in port.ReceiveLocations) 
      { 
       if (location.Name == locationName) 
       { 
        return location; 
       } 
      } 
     } 

     throw new ApplicationException("The following receive location could not be found in the BizTalk Database: " + locationName); 
    } 


    /// <summary> 
    /// Turns the off receive location. 
    /// </summary> 
    /// <param name="vendorName">Name of the vendor.</param> 
    public void TurnOffReceiveLocation(string vendorName) 
    { 
     ReceiveLocation location = Locations[vendorName].ReceiveLocation; 
     location.Enable = false; 
     BizTalkCatalog.SaveChanges(); 
    } 

당신은 내가 "위치라는받을 위치의 사전을 만드는 것처럼 내가 왼쪽으로 몇 가지가 있음을 알 수 있습니다 : 여기 내가 원격으로 수신 위치를 해제하는 윈도우 응용 프로그램에서 사용되는 코드의 일부 발췌입니다 "하지만 아이디어를 얻을 수 있어야합니다. 이 패턴은 상호 작용하려는 모든 BizTalk 개체에 적용됩니다.

1

당신이 솔루션을 찾은 것 같아서 반갑습니다.

Powershell, ExplorerOM 및 BizTalk API를 사용하여 BizTalk 아티팩트를 다양한 상태로 설정하는 비슷한 대안을 원합니다.

수신 위치 중 하나입니다.

스크립트는 이슈를 나열하고 설정하려는 상태를 표시하는 XML 구성 파일을 허용합니다.

스크립트는 마이크로 소프트 스크립트 센터에 게시 된 : http://gallery.technet.microsoft.com/scriptcenter/Set-Artifact-Status-270f43a0

관련 문제