How To Update BizTalk Messaging Manager Configuration Objects (292189)



The information in this article applies to:

  • Microsoft BizTalk Server 2000

This article was previously published under Q292189

SUMMARY

Certain BizTalk Messaging Manager objects, including Document Definitions, Envelopes, and Channels, must be mapped to specifications that are stored in the Web Distributed Authoring and Versioning (WebDAV) repository.

If the WebDAV repository specifications are changed, these BizTalk Messaging Manager objects must be updated before they can be used again with BizTalk Messaging. To update these objects, you can redefine the objects in the BizTalk Messaging Manager wizard.

The following sample code illustrates a way to update the BizTalk Messaging Manager objects programmatically instead of through the BizTalk Messaging Manager wizard.

MORE INFORMATION

To programmatically update the BizTalk Messaging Manager objects, follow these steps:
  1. Paste the following code into Notepad, and save the file with a Microsoft Visual Basic Scripting Edition (.vbs) extension:
    Dim objConfig, objEnvelope, objDocument, objChannel
    Dim rsEnvelopes, rsDocuments, rsChannels
    	
    Set objConfig = CreateObject("BizTalk.BizTalkConfig")
    Set objDocument = objConfig.CreateDocument
    Set objEnvelope = objConfig.CreateEnvelope
    Set objChannel = objConfig.CreateChannel
    Set rsDocuments = objConfig.Documents
    
    While Not rsDocuments.EOF
    	objDocument.Load(rsDocuments("id"))
    	objDocument.Reference = objDocument.Reference 
    	objDocument.Save
    	rsDocuments.MoveNext
    WEnd
    	
    Set rsEnvelopes = objConfig.Envelopes
    While Not rsEnvelopes.EOF
    	objEnvelope.Load(rsEnvelopes("id"))
    	objEnvelope.Reference = objEnvelope.Reference 
    	objEnvelope.Save
    	rsEnvelopes.MoveNext
    WEnd
    	
    Set rsChannels = objConfig.Channels
    While Not rsChannels.EOF
    	objChannel.Load(rsChannels("id"))
    	objChannel.MapReference = objChannel.MapReference 
    	objChannel.Save
    	rsChannels.MoveNext
    WEnd
    	
    Set rsDocuments = Nothing
    Set rsEnvelopes = Nothing
    Set rsChannels = Nothing
    Set objChannel = Nothing
    Set objEnvelope = Nothing
    Set objDocument = Nothing
    Set objConfig = Nothing
    					
  2. From a command line, type the following:
    cscript.exe <path to file>\<filename>.vbs
    					

Modification Type:MinorLast Reviewed:7/13/2004
Keywords:kbhowto KB292189