Sometimes, you want to create a new SendPort that is an exact clone or duplicate of another one in BizTalk Admin Console.
In July, 2014, Richard Seroter provided a BizTalk SendPort Duplicator tool to do this for you. So I recommend you check it out, but in this blog, I want to go through the basics, in a teach mode, of how to do it the “old fashioned way”, and at the same time, familiarize you with editing the dreaded BizTalk Binding files.
Hopefully you already know how to create a binding file, but just in case you don’t, open the BizTalk Admin Console, select the desired application (the binding file is unique to each application).
By default it will go to this directory: C:\Users\YourUserName\Local\BizTalk\Binding Files\YourAppName.BindingInfo.xml, but you can override on the following screen:
I had an app with about 6 orchestrations, 10 receive ports, and 16 send ports, and this spewed out a file that was 8413 lines long. Binding files can be scary and intimidating the first time you open one with an editor.
So to duplicate my SendPort, I opened the above file with NotePad++. Obviously, I’m not going to show that whole file here. What you need to know are the major structural elements of the file.
So based on the above, if I’m looking for a SendPort, you can probably guess I would find it in the SendPortCollection node.
So basically, my goal is to create a binding file with just one SendPort in it. It still needs to be inside the SendPortCollection tag. But all the other tags (elements) can be deleted, except the root element (with the name BindingInfo). So I delete from the Timestamp down to the closing tag of the ModuleRefCollection.
Then I find the SendPort I want, and carefully delete the others. Here’s a brief example of an SMTP (email) SendPort.
So if this is the port you want to duplicate, you would delete all the other SendPorts and keep the close tag SendPortCollection. You could then delete everything below that down to close root element tag named “BindingInfo”.
Make some change to the SendPort name, so that when you load it back in, you will have a duplicate, but under a new name. (You can’t have two with the exact same name.)
Save the file, either in the same name or a new file name.
Then you are ready to import it, which is basically the opposite of the earlier export.
A file picker dialog box will appear, and you can pick the file or past the name, then click “Open” and that will start the upload.
If any error occurs, the entire import will fail, a dialog box will pop-up with a description of the error (hopefully not to cryptic), then you have to edit the file and try again. You might want to make sure the file is valid XML before you import it.
After that, go back and refresh your application, and you should see your duplicated SendPort.
Why duplicate a SendPort? You might have a WCF SendPort, which has a rather complex set of properties. Maybe you just need to have a duplicate of it, to change the URL to point to a different environment, for example TEST vs your QA (Quality Assurance) system.