Skip navigation

I finally learned that Virtual PC on an external HD is an excellent way to do development and general learning.  So I have a baseline BizTalk 2006 r2 and now need a baseline BizTalk 2009.

So 1st step was to install Windows Server 2008 (enterprise Ed).  After several attempts where the installation failed right after entering the Product Key, did not enter the Product Key.  Then and only then did the installation continue and Windows Server 2008 got installed …  all this on the Virtual PC, mind you.

I then did the initial configuration (Computer Information and Security Information – I’m leaving Roles Summary ’til later, when I can figure out what that means).  But without the Product Key, I have essentially an evaluation copy installed.  Need to get the Product Key entered.

How this is done is to open the Control Panel, then open System.  At the bottom the last section is “Windows Activation”.  There is a product id field… and to the right of that is a link, “Change product key”.  Click on this and enter the product key.  Click on the button to accept this key and it will take a few minutes while the system thinks about it.

Now to find out about roles and about the next step in getting BizTalk on board.

This installation was actually a bust.  Turned out the iso image I had was for Longhorn and Longhorn Core… neither of these will work well.  Got seriously stuck on trying to install VStudio 08 – never could get it to install.

Finally got ahold of the right iso for WinSvr08 and the install went find.

[Whoa! Just noticed the date. Six years ago, I was on the Colorado River in the Grand Canyon. We had a small memorial service for the victims of a year earlier]

How do you create a canonical schema? The first part below is how to do this, followed in a later post with why a canonical is used.

Creating the Canonical–
A canonical schema is actually several schemas that are imported into a ‘master’ schema. This example is for a Real Estate Management Company, which manages several varieties of real estate – single family & duplexes, multifamily apartments, office buildings and warehouse facilities. If you try to construct a single schema that will handle each of these situations, the schema will be unwieldy and cumbersome to maintain. Instead we will create a separate schema for each. A schema for the single family and duplexes; a schema for the office buildings; and a schema for the warehouses. This will make it much easier to design and maintain the schemas to be specific to the purpose and to modify when situations arise to do so.

First, create a schema for each of our situations.

But create them in a folder within the project.

Next, create the master schema that is to hold the other schemas. It is not in that folder. Then add a child record to the root node for each schema as created in the first step.

Then go to the properties for the schema node in the master schema and click the ellipsis at the Imports property in the Advanced Group.

This brings up the Imports Dialog. Click on the Add Button, which brings up the BizTalk Type Picker that will list the schemas you’ve created.

From this type picker select the schemas that are to be folded into the master schema (allowed one at a time).

Once all have been selected and imported the Imports Dialog will look something like this.

Click the edit button (“abl”) to change the prefix like has been done at ‘whse’ in the example.

Now highlight each of the blank records that you added to your master schema and click on the dropdown for the Data Structure Type property. The reference schemas are displayed.

For that ‘Record’ make its Data Structure Type one of these schemas.  If you have everything right, your new canonical schema will look something like this.

I do hope that this helps in creating a canonical schema.  Next post will be about why you would wish to use a canonical.

You are creating you map in BizTalk.  What if you have an incoming element that you need to handle based on the data content?  Like if it’s a null do one thing and if its a value do another.

There is a quick one line piece of C# code that you can put in your functoid to handle:

     (conditional statement)? [case, if false]:[case, if true]

For example:

     newVar = (varValue == null) ? “” : varValue;

This will return an empty string if the value is null; otherwise the incoming value is used.

In a scripting functoid using “return (varVal == null)? “”: varVal;” works just as well.

I was using the TCP adapter to allow the mainframe folks to query SAP for pricing info and get a response back.  But there was a problem – somewhere.  The TCP connection?  The message?  I was having a dickens of a time finding out where the error really was.

Then there was the orchestration where there was that red bang (!) that indicated an error.  However, the expression did not have any error, plus the orchestration built and deployed okay.  Of course, the application would fail – somewhere!.  Tracked the error down to something to do with the response message to the TCP adapter.

Very frustrating and another BT developer kept telling me that the red bang was meaningless, because BT was ‘flakey’.  Besides, when I used the TCP Adapter test harness the message would go through without an error!  So, that would tell you that it wasn’t BizTalk, but something with the TCP connection, right?

 But that red bang in the Message Assignment shape just annoyed me to no end, even though there wasn’t any error in the expression.  Finally, and I don’t know exactly what I did, I changed some parameter in the expression and it was underlined and was in error (for finally the 1st time!).  Reading the foot of the dialog, it read that a reference to the Microsoft.BizTalk.Pipline.dll was missing.  What?  That was there (I thought) – quickly checked references and found I had the other references but not that particular one.  Added it in and no more red bang, plus the orchestration now worked.

Why this error didn’t manifest itself to start with – I just don’t know, but sure wasted a lot of time trying to track down where I’d gone wrong with the message, or the pipeline or the flat-file or the TCP connection or the orchestration, etc., etc.

The PGP Encryption software executes from a command line like so:

>pgp –encrypt [file.dat] –user [key id]

>pgp –decrypt [file.dat.pgp] — passphrase [passphrase]

Where “file.dat” is the interchange that is to be encoded by the public key with its “key id”.  “file.dat.pgp” is an encrypted file that is to be decoded by the private key to which the secret “passphrase” must be provided.

The final custom component will execute the encryption software by passing it a constructed command line.  The first step is to recognize that the pipeline will be handling a stream of data, not an entire file, upon which the encryption software must work.  The encryption software needs a defined file, not a stream.  Therefore, we must convert that stream into a file, then convert the completed file back into a stream once the encryption process is completed.  The new FileStream class in BizTalk will work for this purpose.

In general our initial code will be in this form.



Have worked with Windows Services for Unix 3.5 for a bit.  When moving files between windows and Unix using BizTalk, SFU and the File Adapter is a preferred method over moving them using the FTP Adapter (preferred by me at least). 

Found out yesterday that when an interchange is sent from windows to unix using the File Adapter, that there is not a translation of the line delimiter.  In windows the line delimiter is CR LF.  In Unix the line delimiter is LF.

I had seen that SAP would choke on a file that was sent using the CR LF.  (This situation is when a text file is sent directly without using the Adapter for SAP).  When the SAP process would run, it would throw an error and display an invalid character as the line termination.  I had thought that this invalid character was LF only, that the CR LF was not being passed in (i.e., that SFU was translating the delimiter from the windows preferred form to the Unix preferred form).  And I thought that SAP needed the CR LF.

Dumb logic, now that I look back.  SAP wants the delimiter to be the LF only (only now is the big “Doh!”.

Solution?  In the schema change the delimiter from CR LF to LF.   

PGP Encryption is used in the business environment to solve problems related to transmitting data securely.  As in this example (the single slide below).  The accounting firm for Contoso needs to securely transmit confidential data to their client.

PGP is ideally suited for this task.  An interchange is compressed and then encoded in binary format.  Optionally, it can be encoded in an ASCII format, specifically to send via email.

How is this done?  Contoso uses PGP Encryption software to create a “key pair”.  A key pair consists of a public key and a matching private key.  The public key is accessed by its “Key ID” to encode an interchange.  The private key is accessed by using its secret “passphrase” to decode an encrypted interchange.  To be useful Contoso makes its public key available to those entities it may wish to send it secured interchanges.  In our example this is the accounting firm of Dewey, Cheatum & Howe, CPA.  Contoso has created a key pair and sends the public key (or has it available on their website) via email.  D,C&H also has encryption software, and with that software adds that public key to its own public key ring.

Now when the accounting firm needs to electronically send confidential data to Contoso, the data is encrypted with that public key, using that public key’s “Key ID”.  This key id distinguishes which key on the key ring is the right key.

These four slides visually present the process.

In Part 2, we will go over the fundamental pieces that the Custom Pipeline Component needs to performing encoding and decoding with PGP.

I really like BizTalk, facinated with all that it can do, and working hard to learn how to use it properly.

 My first blog will be about the BizTalk Adapter for SAP.  How to get the right software to install it.  Then some of the best ways to use it and managing the adapter in a single BizTalk group.  Stay tuned…


Change of heart (7/28/2007).  Going to do 1st post on a PGP Encryption Component to use in a Custom Pipeline.