locked
Mapping between Send Port and Host Instance RRS feed

  • Question

  • How to retrieve Send port name using host instance name or  from BizTalk server, using C#.NET (WMI)?
    Tuesday, December 2, 2014 10:04 AM

All replies

  • Hi there, 

    I think you posted the query in the wrong forum. 

    In C# you need to reference the Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer

    within the catalog you can enumerate the receive or send ports

    Bas

    Tuesday, December 2, 2014 3:10 PM
  • Hi Bas,

    Enumerating send ports is not an issue but enumerating it according to host instance names is where I got stuck.

    I want send port names according to host instance names. Do you know how to map those?

    Pratibha

    Wednesday, December 3, 2014 5:52 AM
  • Hi Pratibha, 

    this might be your clue. 

    all configuration within BizTalk is stored inside the configuration database :)

    look at the statements below

    Receive host:

    USE BizTalkMgmtDb
    GO
    SELECT RP.nvcName AS ReceivePortName,RL.Name AS ReceiveLocationName,H.Name
    FROM dbo.adm_Host HJOIN dbo.adm_ReceiveHandler RH ON RH.HostId = H.IdJOIN dbo.adm_ReceiveLocation RL ON RL.ReceiveHandlerId = RH.Id AND RL.ReceiveHandlerId = RH.IdJOIN bts_receiveport RP ON RP.nID = RL.ReceivePortId
    WHERE 
    --Specify your receive host name
    H.Name='YourReceiveHostName'

    Send Host:

    USE BizTalkMgmtDb
    GO
    SELECT SP.nvcName AS SendPortName, H.Name AS HostName
    FROM bts_sendport SP JOIN bts_sendport_transport SPT ON SPT.nSendPortID = SP.nID JOIN dbo.adm_SendHandler SH ON SH.Id = SPT.nSendHandlerID JOIN dbo.adm_Host H ON H.Id = SH.HostId
    WHERE
    --Specify the Send Host Name
    H.Name = 'YourSendHostName'

    In the table names used in the query, you see the hierarchy of objects you might have to query in order to get the hostname

    Hope this points you into the right direction

    Wednesday, December 3, 2014 9:12 AM