Microsoft KB Archive/276947

= Cannot Create a Port to an Application When You Use a Non-Default Organization =

Article ID: 276947

Article Last Modified on 10/22/2003

-

APPLIES TO


 * Microsoft BizTalk Server 2000 Standard Edition

-



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(&quot;BizTalk.BizTalkConfig&quot;) Set org = BTConf.CreateOrganization Set port = BTConf.CreatePort

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

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

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

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

'Create Port port.clear port.name = &quot;MyPort to an Application&quot;

'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 = &quot;Direct=OS:.\private$\MyQueue&quot; 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(&quot;name&quot;) = sName) And (aliasrs(&quot;qualifier&quot;) = sQual) _ And (aliasrs(&quot;value&quot;) = sValue) Then GetAliasID = aliasrs(&quot;id&quot;) Exit Do       End If        aliasrs.MoveNext Loop End Function

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

Keywords: kbbug kbpending KB276947

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.