Cannot Create a Port to an Application When You Use a Non-Default Organization (276947)



The information in this article applies to:

  • Microsoft BizTalk Server 2000

This article was previously published under Q276947

SYMPTOMS

You cannot create a port to an application in the BizTalk Messaging Manager when you use an application from an organization other than the default organization. Also, you cannot add applications to any organization other than the default organization in the BizTalk Messaging Manager.

CAUSE

The Applications tab in the Organization Properties dialog box is only available when you are editing the default organization.

RESOLUTION

To create and manage applications to organizations other than the default organization, you must use the BizTalk Messaging Configuration Object Model.

STATUS

This behavior is by design.

MORE INFORMATION

The following is an example of how to create a BizTalk Messaging Port to an application on an organization other than the default organization:
'constant to define the MSMQ transport
Const BIZTALK_TRANSPORT_TYPE_MSMQ	= 128 		

'Create objects to be used
Set BTConf = CreateObject("BizTalk.BizTalkConfig")
Set org = BTConf.CreateOrganization		
Set port = BTConf.CreatePort

'Create Organization - note the IsDefault property is not being set
org.clear
org.name = "MyOrg"
org.Comments = "This is a new non-default organization"
org.CreateApplication "MyApplication"

'Get handle to newly created organization
lOrgMyOrg = org.Create

'Get handle to aliasID for newly created organization
lAliasMyOrg = GetAliasID ("Organization", "OrganizationName", "MyOrg", org)

'Get handle to application of newly created organization
lAppMyOrg = GetAppID ("MyApplication", org)

'Create Port
port.clear
port.name = "MyPort to an Application"

'Set the endpoint object - port.DestinationEndPoint
port.DestinationEndPoint.Organization = lOrgMyOrg
port.DestinationEndPoint.Alias = lAliasMyOrg
port.DestinationEndPoint.Application = lAppMyOrg

'Set transport properties for port.PrimaryTransport
port.PrimaryTransport.Address = "Direct=OS:.\private$\MyQueue"
port.PrimaryTransport.Type = BIZTALK_TRANSPORT_TYPE_MSMQ

'Create Port
lPortMyApp = port.Create					

'Clear objects
Set port = Nothing
Set org = Nothing
Set BTConf = Nothing

Function GetAliasID(sName, sQual, sValue, org)
    Set aliasrs = org.Aliases
    Do While Not aliasrs.EOF
        If (aliasrs("name") = sName) And (aliasrs("qualifier") = sQual) _
					And (aliasrs("value") = sValue) Then
            GetAliasID = aliasrs("id")
            Exit Do
        End If
        aliasrs.MoveNext
    Loop
End Function

Function GetAppID(sName, org)
    Set Apprs = org.Applications
    Do While Not Apprs.EOF
        If Apprs("name") = sName Then
            GetAppID = Apprs("id")
            Exit Do
        End If
        Apprs.MoveNext
    Loop
End Function 
				

Modification Type:MajorLast Reviewed:10/22/2003
Keywords:kbbug kbpending KB276947