Biztalkien

Leonid Ganeline - Microsoft BizTalk Server & WCF

  Home  |   Contact  |   Syndication    |   Login
  66 Posts | 0 Stories | 84 Comments | 13 Trackbacks

News





free counters

Archives

Post Categories

Image Galleries

BizTalk

Friday, March 12, 2010 #

Today I investigated one strange error working with Dynamic SMTP Port.
 
Event Type: Error
Event Source: BizTalk Server 2006
Event Category: BizTalk Server 2006
Event ID: 5754
Date: ********
Time: ********AM
User: N/A
Computer: ********
Description:
A message sent to adapter "SMTP" on send port "*********" with URI "mailto:********.com" is suspended.
Error details: Unknown Error Description 
MessageId:  {********}
InstanceID: {********}
 
My code was pretty simple and the source of the error was hidden somewhere inside it.
 
msg_MyMessage(SMTP.CC) = var_CC;
msg_MyMessage(SMTP.From) = var_From;
msg_MyMessage(SMTP.Subject) = var_Subject;
msg_MyMessage(SMTP.EmailBodyText) = var_Message;    // #1   
msg_MyMessage(SMTP.SMTPHost) = " localhost ";
msg_MyMessage(SMTP.SMTPAuthenticate) = 0;

When I added line #2, this frustrating error disappeared.
 
 msg_MyMessage(SMTP.EmailBodyTextCharset) = "UTF-8"; // #2

Conclusion:
If we use the SMTP.EmailBodyText property, we must set up the
SMTP.EmailBodyTextCharset property.

To me it looks like a bug in BizTalk. [Maybe it is "by design", but in this case give us a useful error text!!!]
And don't ask me how much time I've spent with this investigation.
 

========================================================

[2010-03-15 addition] This error is "by design". See http://msdn.microsoft.com/en-us/library/aa578155(BTS.20).aspx


Thursday, February 25, 2010 #

BizTalk: Compensation Model
 

Charles Young mentioned, the Compensation is one of the most under-used features of the BizTalk.
[“
BizTalk Server 2006: The Compensation Model
http://geekswithblogs.net/cyoung/articles/100424.aspx]
If you didn’t read his article, I would strictly recommend it. Next article to read is
[“
Transactions and Compensation Using BizTalk Server
http://blogs.msdn.com/richardbpi/archive/2006/12/06/transactions-and-compensation-using-biztalk-server.aspx]
by Richard Seroter.

There are still many questions in using Compensation in BizTalk.
·         What is the proper order of the Exception and Compensating blocks (handlers), Compensate shapes?
·         Do we have to rethrow the Exceptions?
·         Do we have to use Compensate shape for the current transaction or for the internal transactions?
·         What exactly does the Compensate shape?
·         What is the difference between Atomic and Long-Running transactions from the Compensation point of view?
 
Let’s start from the theory.
Compensation and Rollback
I have to use term the Rollback in this document. It is not from the BizTalk Documentation.
Data_1 --> [Transaction: Data_1to2] --> Data_2
I use the Rollback term like the same term in the database transactions. Rollback means restoring all data to the point before transaction. It is completely automatic, atomic process. We cannot control rollback. Only one operation is possible, Start Rollback. It rolls back only the local orchestration data, orchestration variables and parameters.
The local orchestration data outside the transaction could be only Data_1 or Data_2. When Transaction is Committed, the data is Data_2. When Transaction is Rollbacked, the data automatically returns to the pre-transaction state, to the Data_1. We never get the Data_1to2 outside the Transaction. We all know this; it is ABC of the Transaction model.
But BizTalk is not a data base server as SQL Server and transaction in BizTalk is not a data base transaction. For example the Send shape inside transaction scope can send message to the external system and change data in this system. In general case BizTalk cannot automatically roll back this operation and won’t do this. We have to manually create a code to roll back the external changes. Atomic transaction might change the external system in the same way as Long-Running transaction. BizTalk helps us with managing this roll back procedure. We include the custom roll back code in the Compensation block. This code is invoked automatically by BizTalk or manually by a Compensate shape and the whole process called the Compensation.
Compensation it is not a Rollback. It is another process.
Compensation is a controlled process. Here is a typical example: code inside BizTalk transaction inserts rows in the database. BizTalk does not automatically rollback this operation. But it gives us possibility to implement [maybe] complex business process of deleting inserted rows. Plus, the last uncontrolled step of the Compensation is a Rollback. We implement some custom business process of compensation and then BizTalk invoke Rollback.
All Rollbacks and Compensations are initiated by an Exception. If an Exception is fired inside transaction, BizTalk invokes Rollback, but Compensation for this transaction is usually prohibited.
BizTalk invokes Rollback, but before that BizTalk invokes the Exception block of this transaction, if there is such block and if this block catches the Exception.
Note: Compensation block and Compensation shape are different things. Compensation shape is a method to call the Compensation block.
Atomic and Long-Running transactions
By design Atomic transaction should be used for the fast and simple procedures. The data before Atomic transaction is not persisted on the disk. Atomic transaction is quick that’s why it does not damage the total reliability. You can mention that Atomic transaction property the Timeout automatically set up to 60 sec, but not for the Long-Running transaction. Moreover only the Atomic transaction has the Property the Retry because it makes sense to automatically retry only the short process not the long one.
The likelihood of the system crash is bigger in the durations of hours and days than in seconds. That’s why data before Long-Running transaction persisted to disk. That’s why the orchestration data used in the Long- Running transaction must be serializable. That’s why the Long-Running transaction theoretically slower than Atomic transaction.
Note: Atomic transaction in BizTalk is not atomic in strict sense. It can include requests to the external processes, calls to the .NET classes, etc. Each of these processes could change something outside the orchestration and the transaction Rollback does not automatically roll back all these changes. It would be dangerous.
The Atomic transaction is short by definition. It cannot nest other transactions inside. The Atomic transaction is processed as a single unit of work. If Exception is fired inside the Atomic transaction, all we have to do is to roll back this transaction. And BizTalk makes this automatically. We cannot change this roll back process no matter what sort of Exception was fired.
Seems this is the main difference between n the Atomic and Long-Running transactions in BizTalk, how they behave in case of the internal Exception. Atomic transaction always automatically performs Rollback. We cannot avoid this Rollback and cannot do something else. Long-Running transaction could catch the Exception in the optional Exception block and process the rollback in specific custom code. But the Exception block cannot prevent the automatic Rollback. The Rollback occurs after executing the Exception block. If a Long-Running transaction does not have the Exception blocks it processes an Exception the same way as an Atomic transaction.
Compensations and Exceptions
Rule 1: Transaction block can get only one custom Compensation block.
Rule 2: If the Compensation block is not defined, the Transaction uses the default Compensation. Default Compensation is the Compensation for the current Transaction. That means the unwiring the Compensations for the nested Transactions and Rollback (restoring the Orchestration variables).
Rule 3: Firing an Exception is the only way to initialize the Compensation process.
Rule 4: Atomic transaction block cannot get the Exception block.
Rule 5: Long-Running transaction use the default Exception block for the “General Exception” if the custom Exception block for the “General Exception” is not defined. Default Exception block invokes the Compensation shape for current transaction and rethrow the Exception.
Rule 6: Compensation shape can be inserted only inside Exception block or Compensation blocks.
It seems obvious but anyway…
We can include the Compensate shape nowhere but only in the Exception and Compensation blocks. We cannot start the compensation process arbitrary. No exception – no compensation! Sometimes we need to utilize the automatic compensation ability of the BizTalk in the ordinary business process. Firing Exception is not the ordinary situation; an exception should be always indicator of the error in process. But here we have to use exception, there are no other ways.
Rule 7: Transaction that fired the Exception processes a Rollback right after this Exception. We cannot compensate this transaction.*
*) As Charles Young mentioned here is a workaround for this rule (see the “Using Compensation Blocks on L-R Transactions” topic in his article), but you have to use undocumented features of the BizTalk. BizTalk is wisely trying to prevent compensating uncommitted transaction.
Standard compensation process (Example)
Let’s cover the standard compensation process.
Below is the simple orchestration with one LR nesting transaction (1---) and two nested transactions (11… and 12…).
Second nested transaction fired the Exception.
Let see what is going on here:
1.       Code generates the DivideByZeroException
2.       The Exception is caught in the Exception block of the same Transaction.
3.       The Exception is rethrown.
4.       BizTalk rolls back the Transaction, that means it restore the orchestration variables and parameters.
5.       The Exception is caught in the Exception block of the nesting, outer Transaction.
6.       Calls to the Compensating of the nested Transactions in the revers order. Compensation of the 12… cannot be executed because this transaction was not Committed (completed).
7.       Compensating of the 11… Transaction.
8.       Exception is rethrown. Orchestration is suspended.
 
Why the Compensation blocks the Comp12 and Comp 1 were not executed? For different reasons.
Comp12 was not executed because Transaction the 12… was not committed but rollbacked and a try to call the Compensation in the C_Ex 1 block was skiped.
Comp1 was not executed because it could be called only from the outer, nesting transaction. We don’t have such transaction here.
 
 
The trace log was:
1 --- 
1 --- 11... 
1 --- 11... 12... (1)
1 --- 11... 12...   >>> Exc 12 (2)
1 --- 11... 12...   <<< Exc 12 Rethrow Exception ******** (3) (4)
1 --- 11...   >>> C_Ex 1 (5)
1 --- 11...   >>> Comp 11 (6)
1 --- 11...   <<< Comp 11 (7)
1 --- 11...   <<< C_Ex 1 Rethrow Exception ******** (8)
 
 
Below is the XLANGs code generated by BizTalk Orchestration Editor:
 
module GLD.Samples.Compensation
{
    internal service longrunning transaction StandardCompensation
    {
        port implements PortType_1 Control_R;
        message System.Xml.XmlDocument msg_XmlDocument;
        System.Int32 var_int;
        System.String var_State;
        body ()
        {
            activate receive (Control_R.Operation_1, msg_XmlDocument);
            var_int = 0;
            var_State = "";
            scope longrunning transaction tx_1
            {
                System.Int32 var_IntLevel1;
                body
                {
                    var_IntLevel1 = 0;
                    var_State = "1 --- ";
                   
                    System.Diagnostics.Trace.WriteLine(var_State);
                    scope longrunning transaction tx_11
                    {
                        body
                        {
                            var_State = var_State + "11... ";
                           
                            System.Diagnostics.Trace.WriteLine(var_State);
                        }
                        compensation ()
                        {
                           
                            System.Diagnostics.Trace.WriteLine(var_State + " >>> Comp 11");
                           
                            System.Diagnostics.Trace.WriteLine(var_State + " <<< Comp 11");
                        }
                    }
                    scope longrunning transaction tx_12
                    {
                        body
                        {
                            var_State = var_State + "12... ";
                            System.Diagnostics.Trace.WriteLine(var_State);
                              // Exception!!!
                            var_int = var_int / System.Convert.ToInt32("0");
                        }
                        exceptions
                        {
                            catch
                            {
                                System.Diagnostics.Trace.WriteLine(var_State + " >>> C_Ex 12");
                                System.Diagnostics.Trace.WriteLine(var_State + " <<< C_Ex 12 Rethrow Exception ********");
                                throw;
                            }
                        }
                        compensation ()
                        {
                            System.Diagnostics.Trace.WriteLine(var_State + " >>> Comp 12");
                            System.Diagnostics.Trace.WriteLine(var_State + " <<< Comp 12");
                        }
                    }
                }
                exceptions
                {
                    catch
                    {
                        System.Diagnostics.Trace.WriteLine(var_State + " >>> C_Ex 1");
                        if (succeeded(tx_12))
                        {
                            compensate tx_12 ();
                        }
                        if (succeeded(tx_11))
                        {
                            compensate tx_11 ();
                        }
                        System.Diagnostics.Trace.WriteLine(var_State + " C_Ex 1 Rethrow Exception ******** ");
                        throw;
                    }
                }
                compensation ()
                {
                    System.Diagnostics.Trace.WriteLine(var_State + " >>> Comp 1");
                    compensate tx_1 ();
                    System.Diagnostics.Trace.WriteLine(var_State + " <<< Comp 1");
                }
            }
        }
    }
}
 
The uncear points in the Compensation Model
To me there are several confusing things in the Compensation model.
First, the Compensation blocks are called outside. Event to call the Compensation comes outside! It is pretty unusual from the developer experience. One more time: the Compensation block is called outside. We are waiting that methods start from the first operator, and the exceptions catch blocks are placed in the end of code. The Exception blocks in the Orchestration are placed as we are waiting for, in the end of the code. Compensation blocks placed in the same place but worked in opposite manner. It is unintuitive. Now the similar graphic presentation of the Exception and Compensation blocks mixed with different behaviour of the Exception and Compensation blocks. It is misleading.
Second, Rollbacks and Compensation are kind of unsynchronized. I will tell about this in the next sample.
Compensation Model process (Example)
Let’s cover the more complex compensation process.
This is the transaction tree:
Below is the orchestration picture. Nesting transaction was implemented in nested loops.
 
Exception was fired in the 1222 transaction.
The trace log was:
------------------------------- 5 ----------------------------
1000*** 
1000*** 1100=== 
1000*** 1100=== 1110--- 
1000*** 1100=== 1110--- 1111... 
1000*** 1100=== 1110--- 1111... 1112... 
1000*** 1100=== 1110--- 1111... 1112... 1120--- 
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212... 
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212... 1220--- 
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212... 1220--- 1221... 
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212... 1220--- 1221... 1222... 
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212... 1220--- 1221... 1222... ******* Throw exception(1)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212... 1220--- 1221...   >>> C_Ex 3(2)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212... 1220--- 1221...   >>> Comp 4(3)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212... 1220--- 1221...   <<< Comp 4(4)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212... 1220--- 1221...   <<< C_Ex 3 ******* ReThrow exception(5)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212...   >>> C_Ex 2(6)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212...   >>> Comp 3(7)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212...   >>>Comp 4(8)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212...   <<< Comp 4(9)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... >>> Comp 4(10)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... <<< Comp 4 (11)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212...   <<<Comp 3(12)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 1200=== 1210--- 1211... 1212...   <<< C_Ex 2 ******* ReThrow exception(13)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122...   >>> C_Ex 1(14)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122...   >>> Comp 2(15)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122...   >>> Comp 3(16)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122...   >>> Comp 4(17)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122...   <<< Comp 4(18)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121...   >>> Comp 4(19)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121...   <<< Comp 4(20)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122...   <<< Comp 3(21)
1000*** 1100=== 1110--- 1111... 1112...   >>> Comp 3(22)
1000*** 1100=== 1110--- 1111... 1112...   >>> Comp 4(23)
1000*** 1100=== 1110--- 1111... 1112...   <<< Comp 4(24)
1000*** 1100=== 1110--- 1111...   >>> Comp 4(25)
1000*** 1100=== 1110--- 1111...   <<< Comp 4(26)
1000*** 1100=== 1110--- 1111... 1112...   <<< Comp 3(27)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122...   <<< Comp 2(28)
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122...   <<< C_Ex 1(29)
.......................................................................
1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122... 
 
Picture of whole compensation process:
 
As an initial exception (1) is fired, there are several stages in the compensation process. A catch block follows after each exception, then compensations (blue arrow) and rollbacks (green arrow) for nested transaction(s). Each compensation is followed by a rollback with nested compensations and rollbacks in between.
For example, an Exception (5) in the Catch Exception block the “C_Ex 3” of the transaction 1220 is caught into the Catch Exception block (6) of the Transaction 1200, then follows the Compensation “Comp3” for the Transaction 1210 (7), the Compensation (8) and the Rollback (9) for the Transaction 1212, the Compensation (10) and the Rollback (11) for the Transaction 1211, the Rollback (12) for the Transaction 1210.
You can mention one interesting detail in the whole compensation process: All compensation blocks were called and all compensation code inside was invoked. But the orchestration data was not returned to the initial state. The orchestration data was roll backed only for the transaction branch where exceptions were fired, for the transaction 1200 and nested transactions. We could predict the roll backed data would be the “” but it is “1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122...”
Is it a bug in BizTalk?
Seems the compensation process is tuned up only for the “default” compensation model for some reason. In this model each implicit Exception block is finished by a Throw Exception operator. As you can remember the Default Exception block invokes the Compensation shape with current transaction and rethrow an initial Exception. If we follow this model we have got a predictable rollback process.
In the preceding example we have to nest the Transaction 1000 in outer Transaction and add a Throw Exception operator in “C-Ex 1” Exception block. In this case the data would be roll backed to the “” value in this outer transaction.
Rule 7: The orchestration data is roll backed to the initial point of the transaction where the last exception is rethrown.
For example, the last exception was rethrown in the Transaction 1200. The initial data for this Transaction was “1000*** 1100=== 1110--- 1111... 1112... 1120--- 1121... 1122...”. The orchestration data was roll backed to this value, not to the initial data for the outer compensated Transaction 1000.
Conclusion
Let’s summarize how to create the standard compensation process.
1.       Define the Compensation blocks for all transaction you want to be compensated. This is the most chalenging task.
2.       Define the Exception blocks where the Exception(s) should be cought.
3.       Add the Compensate shape(s) to this Exception block. Define what transaction you want to compensate. The standard way is to define a current transaction. All nested transactions would be compensated automaticaly in the right order.
4.       If you need a predictable rollback process for the orchestration data, rethrow an Exception in each Exception block where you added the Compensate shape.
 

Monday, February 22, 2010 #

BAM Operations, a brief summary
Installing the BAM infrastructure
BAM infrastructure composed on the base of the SQL Analysis Services and the SQL Integration Services. The SQL Notification Service is an optional element.
1.       Before installing BAM make sure the SQL Analysis Services and the SQL Integration Services are installed. If not, install them.
2.       Create the BAMAnalysis and BAMStarSchema databases. It can be done in separate step or while the BizTalk configuration.
2.1.    Start the BizTalk Server Configuration tool.
2.2.    Choose the BAMTools on the left side of window.
2.3.    Check on option the “Enable Analysis Services for BAM aggregations”.
2.4.    Fill in Server Name with the same value as value for others databases. For example, “DEV\BIZTALK”.
2.5.    Push the “Apply Configuration” button. Click “Next>” button.
2.6.    Make sure there are no errors.
Note: to get access to the BAM Portal in the cluster BizTalk deployment use http://seroter.wordpress.com/2007/04/30/production-ready-bam-security-and-deployment/ article by Richard Seroter.
Development and Deploying
Deployment is separated to two parts. One is creating the logical data structure, second is mapping the logical structure to the BizTalk data.
There are two roles in development respectively. Business Analyst creates the logical tracking; BizTalk developer maps the logical tracking structure to the BizTalk application data.
For details read the MSDN documentation, “Using Business Activity Monitoring” at http://msdn.microsoft.com/en-us/library/aa561326.aspx.
Business Analyst uses the Microsoft Excel with special Add-In to create the Activities and Views, and then export them to the Xml file. It is the BAM Definitions.
BizTalk developer uses the Tracking Profile Editor (TPE) to map BAM Definitions to the BizTalk Orchestrations. TPE produces the Tracking Profile.
Deployer is another role in the process. In development environment it is a developer, in the production environment it is a System Administrator.
Deployer uses the bm.exe utility to deploy the BAM Definitions and TPE (in the development environment) or the BttDeploy.exe utility (in the production environment) to deploy Tracking Profile.
Development and Deployment Considerations
If we need to change something in BAM infrastructure first we have to undeploy old Tracking Profile and BAM Definitions then redeploy the new Tracking Profile and BAM Definitions. It is a simple process if we have the old Tracking Profile and BAM Definitions. If we lost them, the undeployment process is more complicated. That means we have to store deployed Tracking Profile and BAM Definitions!
Undeployment
Use deployed files <BAM Definitions>.xml and <Tracking Profile>.btt.
1.       Open the Command line window (Start / Run…/ >cmd.exe).
2.       Go (>cd) to the <BizTalk>\Tracking\ folder.
3.       Undeploy BAM Definitions:
a.       >bm remove-all –DefinitionFile:< BAM Definitions>.xml –Server:<server>
4.       Undeploy Tracking Profile:
a.       >BttDeploy <Tracking Profile>.btt /remove [/mgdb <server name[,port]>\<database name>]
If we lost the <BAM Definitions>.xml and <Tracking Profile>.btt files, use the
>bm.exe get-defxml -FileName:<output file> [ -Server:<server> ] [ -Database:<database> ]
to get them. If we before that deployed several Definitions, we have to edit the new DefinitionFile.
Deployment
Use files from the BAM\Current folder.
5.       Copy the <BAM Definitions>.xml and <Tracking Profile>.btt files to the <BizTalk>\Tracking\ folder.
6.       Open the Command line window (Start / Run…/ >cmd.exe).
7.       Go (>cd) to the <BizTalk>\Tracking\ folder.
8.       Deploy BAM Definitions:
a.       >bm deploy-all –DefinitionFile:< BAM Definitions>.xml –Server:<server>
9.       Deploy Tracking Profile:
a.       >BttDeploy <Tracking Profile>.btt /mgdb <server name[,port]>\<database name>
10.   10. Set the access permissions for the BAM Portal users:
a.       >bm add-account -AccountName:<BAMUsersGroup> -view:<ViewName>
- use it for each view in the BAM Definition.
 
This creates the database artifacts as tables, views, triggers, stored procedures in the databases.
Deployment scripts
Create the deployment scripts (with all above steps) and place them and BAM files to a predefined folder structure.
        Folder structure:
o   BAM\Scripts       – folder for scripts
o   BAM\Current    – folder for the BAM files to be deployed. We can edit them.
o   BAM\Last           – folder for the BAM files deployed right now. We cannot edit them.
o   BAM\Last.<Date>       – folders for the BAM files deployed before. They are for undo. <Date> should be sortable, that means a format as YYYYMMDD. For Example, 20100525.
·         Script user has to be in BAM administrators group.
Managing the BAM Infrastructure
The BAM infrastructure consists of the BAM workbook views, BAM Portal, BAM deployments, the BAM Data Transformation Services (DTS) packages, and the BAM databases. For more information about the BAM infrastructure, see http://msdn.microsoft.com/en-us/library/aa561239.aspx .
How to manage this infrastructure see “Managing the BAM Dynamic Infrastructure” http://msdn.microsoft.com/en-us/library/aa578097.aspx .
 

Tuesday, November 17, 2009 #

The problem is with three Empty-Null cases.
Is it possible to separate all these cases in Expression shapes of the Orchestration?
For example, we have the record with <name> element, in such flawors:
 

 case: "NonEmpty"

<ns0:People>
    <
ns0:Name>Name_0</ns0:Name>
    <
ns0:IsDependent>IsDependent_0</ns0:IsDependent>
..

case: "Empty"

  <ns0:People>
    <
ns0:Name></ns0:Name>
    <
ns0:IsDependent>IsDependent_0</ns0:IsDependent>
..

 case: "OneTag"

<ns0:People>
    <
ns0:Name/>
    <
ns0:IsDependent>IsDependent_0</ns0:IsDependent>
..

 case: "Null"

<ns0:People>
   <!-- NO NODE: <ns0:Name>Name_0</ns0:Name>-->
    <ns0:IsDependent>IsDependent_0</ns0:IsDependent>
..

Is it possible to separate all these cases in Expression shapes of the Orchestration?

There is no information into the MSDN about this [http://msdn.microsoft.com/en-us/library/aa561906(BTS.10).aspx]

I tried to use the xpath() function in two variants, one with "string(xpath_expression)" second with "xpath_expression"

 

Expression Shape:
[
System.Diagnostics.Trace.WriteLine("== with string() ====================================================================");
var_xpathString = "string(/*[local-name()='Root' and namespace-uri()='http://MapTest.IncPerson']/*[local-name()='People' and namespace-uri()='http://MapTest.IncPerson']/*[local-name()='Name' and namespace-uri()='http://MapTest.IncPerson'])";
 
System.Diagnostics.Trace.WriteLine("[" + System.Convert.ToString(xpath (msg_SourceRoot, var_xpathString)) + "]");

if ( xpath (msg_SourceRoot, var_xpathString) == null)
    { System.Diagnostics.Trace.WriteLine("Name == null"); }
 
else if ( xpath (msg_SourceRoot, var_xpathString) == "")
    { System.Diagnostics.Trace.WriteLine("Name == Empty");}
else
    { System.Diagnostics.Trace.WriteLine("Name != null && Name != Empty"); }

System.Diagnostics.Trace.WriteLine("-- no string() --------------------------------------------------------------------");
var_xpathString = "/*[local-name()='Root' and namespace-uri()='http://MapTest.IncPerson']/*[local-name()='People' and namespace-uri()='http://MapTest.IncPerson']/*[local-name()='Name' and namespace-uri()='http://MapTest.IncPerson']";

System.Diagnostics.Trace.WriteLine("[" + System.Convert.ToString(xpath (msg_SourceRoot, var_xpathString)) + "]");

if ( xpath (msg_SourceRoot, var_xpathString) == null)
    { System.Diagnostics.Trace.WriteLine("Name == null"); }
else if ( xpath (msg_SourceRoot, var_xpathString) == "")
    { System.Diagnostics.Trace.WriteLine("Name == Empty"); }
else
    { System.Diagnostics.Trace.WriteLine("Name != null && Name != Empty");}
]

I.e. the "string(xpath_expression)" expression is used in the firs section, the"xpath_expression" is used  in the second.

 

Result is:

"NonEmpty" == with string() ====================================================================
[Name_0]
Name != null && Name != Empty
-- no string() --------------------------------------------------------------------
[Microsoft.XLANGs.Core.Part+ArrayBasedXmlNodeList]
Name != null && Name != Empty

"Empty"== with string() ====================================================================
[]
Name == Empty
-- no string() --------------------------------------------------------------------
[Microsoft.XLANGs.Core.Part+ArrayBasedXmlNodeList]
Name != null && Name != Empty

"OneTag"== with string() ====================================================================
[]
Name == Empty
-- no string() --------------------------------------------------------------------
[Microsoft.XLANGs.Core.Part+ArrayBasedXmlNodeList]
Name != null && Name != Empty

"Null"== with string() ====================================================================
[]
Name == Empty
-- no string() --------------------------------------------------------------------
[]
Name == null

Conclusion:
* I cannot separate the cases "Empty" and "OneTag"
* I can separate the cases "Empty and "Null" with "xpath_expression", not with "string(xpath_expression)" expression
* "Null" case does not throw an exception.
* xpath expression inside string() works fine to get all three cases ("Empty", "OneTag", "Null") under one "if" statement. And here it returns only "" (Empty string).

Friday, July 31, 2009 #

Version 2.1, 2009-08-09
1        How to use this document
To accommodate this document for the specific solution:
·        Create the real names in Appendix or create a separate Dictionary document.  See Instructions in Appendix.
·        Review the text, marked with [TBD] flag, and change it for your case.
The “Naming guidelines for the .NET Framework types” [ http://msdn.microsoft.com/en-us/library/xzf533w0(VS.71).aspx ] are used as a basis of this document. Also see the “Naming Convention” in Wikipedia [ http://en.wikipedia.org/wiki/Identifier_naming_convention ]
Names should be short, sortable, readable, discoverable, and self-described.
The main test for constructing name rule should be in questions:
·        In what kind of places can I see this name?
·        How easily can I work with the name in these places?
Work” means to read, to find, and to understand sense without errors. Usually we work with names in lists. Think about these places like about namespaces in programming languages.
Short names:
  • Create as short as possible name.
  • Use abbreviations only in restricted cases. See article the “Abbreviationshttp://msdn.microsoft.com/en-us/library/141e06ef(VS.71).aspx
  • Use prefixes and suffixes only to differentiate names.
  • If you see one word in several places of the full name, consider this as a bad signal. Try to redesign the terms used in the names.
Sortable:
  • Create “sortable” name. That means using more generic/important part of the name in the leftmost position. For example, prefer the name Folder_20090515 than the name Folder_05_15_2009.
Readable:
  • Use the name case compatible with the well-known practices in programming languages/protocols with respect to upper and lower cases. For instance, the XML namespaces (URL) should be in lower case format, but the other names should be in the Pascal format. See the “Capitalization Styles” article  [http://msdn.microsoft.com/en-us/library/x2dbyw72(VS.71).aspx ]
    If the word with specific case is widely used in company, don’t force to change it to the Pascal format.
  • Decorate infixes, prefixes or suffixes with lower case and with undrscore. For example: TicketBatch_type, Source1 _and_Source2_to_Target, msg_MyRequest.
Discoverable:
  • The name should be discoverable. That means we easily should understand by the name of the artifact where we can find the artifacts or additional information about it. Names should link artifacts. Say, the schemas with XML namespace the http://domain.company.com/solution/project/2009-05-14 definitely should be in the project the Company.Domain.Solution.Project and in assembly the Company.Domain.Solution.Project.dll.
Self-described (Semantics):
  • Create name form the “business point of view” not form the “developer point of view”, especially the name exposed outside solution.
  • Don’t use generic terms in the names. Examples: Send, Receive, Service, Message, Transformation, Schema, Map, Orchestration, BizTalk.
  • Place a frequently used term into the shared dictionary with comment about where do use it and do not use.
  • Several artifacts have the full names (composited names) and short names. Usually we can easily understand what name we use in the specific context.
·        If we need to add one or more logical grouping into the name, use the composited names created with words separated with dot. In specific contexts the separation symbol can be different, like underscore, dash or backslash. Each <…ShortName> can be a composite name. Composite names can be used for each part of the full names, as Company, Domain, Solution, and Project. For example, you can use name the Schemas.Niem for the project short name.
3        General names
3.1       Syntax
<Company>
<Domain>
<Solution> =:
           <Company>.<Domain>.<SolutionShortName>
<Project> =:
           <Solution>.<ProjectShortName>
3.2        Examples
·        Solution name: short name – MySolution,  full name - MyCompany.MyDomain.MySolution
·        Project name: short composite name – Schemas.Niem; full name - MyCompany.MyDomain.MySolution.Schemas.Niem
4        Names inside BizTalk Solutions
We use term the solution in the Visual Studio meaning, it is a name of the solution we see in the Solution Explorer window in the Visual Studio. Sometimes we mix solution and project terms but not in this document.
BizTalk application is named as solution.
<Solution> =:
           <Company>.<Domain>.<SolutionShortName>
<ApplicationName> =: <Solution>
For example, for the MySolution solution use the MyCompany.MyDomain.MySolution full name.
4.2        Projects, Assemblies, .NET namespaces
We use term the project in the Visual Studio meaning, it is a name of the project we see in the Solution Explorer window in the Visual Studio.
<Project> =:
            <Solution>.<ProjectShortName>
<AssemblyName>           =: <Project>
<Namespace>                =: <Project>
For example, for the MyProject project use the MyCompany.MyDomain.MySolution.MyProject project full name, the MyCompany.MyDomain.MySolution.MyProject assemblyname, and the MyCompany.MyDomain.MySolution.MyProject namespace.
We should separate the .NET namespaces and the XML namespaces. They are different things and used in different places. For brevity we use term the namespace exactly for the .NET namespace and always use the term the XML namespaces for the XML namespaces.
Note: After creating a new project, copy the project name property to the project properties the “Assembly Name” and the “Default Namespace”.
Use the predefined folder structure on all development machines and, if it is possible, on the Test and Product servers. This eliminates the errors and deployment effort because several BizTalk artifacts use the absolute file paths in configuration.
<SolutionsRootFolder> =: c:\Solutions
<SolutionFolder> =:
           <SolutionsRootFolder>\<Solution>
<ProjectFolder> =:
           <SolutionFolder>\<ProjectShortName>
For example, the MyCompany.MyDomain.MySolution.MyProject project is placed in the c:\Solutions\MyCompany.MyDomain.MySolution\MyProject folder.
Use very strict rules for the XML namespaces, because the XML documents expose the data interfaces to the outer world. The XML namespaces should follow the industry standards and the corporate standards. The exposed interfaces are immutable, why we should use versioning for XML namespaces. XML namespaces work as global unique identifiers for nodes of the XML documents.
We must use the URL or URN formats to XML namespaces. Feel free to use one of these standards. See the “Namespaces in XML 1.0 (Second Edition)http://www.w3.org/TR/xml-names/ for more information.
[TBD: Here I use URL format because it is widespread and users are more familiar with it. Note two confusing things about using URL as an XML namespace. First, the URLs are used as addresses. URL in XML namespace works mostly as a global unique identifier, not as an address. Second, reverse names order in URLs, for example, not the http://com.company.domain but http://domain.company.com .]
[TBD: Here I use the URL reverse order for the XML namespaces. Not for the full name but for the “before-solution” part of the name, for the first part of the name before first backslash. If you don’t want to use XML namespaces that works as the web addresses, consider to use the XML namespaces in the generic, nonreversible, sortable order.]
Compose the URLs for the XML namespaces in the reversal order like http://domain.company.com/solution/schemas/2009-05-15 and add the “com” part of URL.
<TargetNamespace> =:
           http://<Domain>.<Company>.com/<SolutionShortName>/<ProjectShortName>/<Version
<Version> =:
            <date> 
           [in YYYY-MM-DD format]
[TBD We considered using two version formats. One format is like 1.0.0.1, the format used for the .NET assemblies. See http://msdn.microsoft.com/en-us/library/51ket42z.aspx . The second version format uses a date. Use the first one only if you can implement strict versioning rules, and in this case you can create/have some version approval procedure. We use here the date format.]
  • Use the same XML namespace for all schemas in one project. Schemas in one project (with equal XML namespace) are differentiated by the root node names. Do not place the root node name inside the XML namespace.
  • Use the project creating date for the first versions of all schemas inside project.
  • Use the current date for the second and next versions.
  • Create the new version only if the old one is published to production (test) environment. Do not create new versions inside development cycles.
  • Use the YYYY-MM-DD date format to make the names “sortable”. Do not use MM/DD/YY format.
  • URLs are case-sensitive (Yes, they are!) but do not use the upper case letters in XML namespaces.
For example, for the MyCompany.MyDomain.MySolution solution and the MyProject project the XML namespace should be the http://mydomain.mycompany.com/mysolution/myproject/2009-05-15 for the first versions of all schemas, if this project was created in 2009-05-15.
6        BizTalk artifacts
6.1        Orchestrations, Schemas, Pipelines
Names of these artifacts appear together with BizTalk application name mostly everywhere. We don’t need to use composite names. Use simple names for the names.
Note: If you see one word in several places of the full name, consider this as a bad signal. Try to rethink the terms used in the names. I repeat this rule here, because exactly in the full names of orchestrations, schemas and pipelines you can frequently see the repetitive words.
6.2        Maps
<Map> =:
        <SourceSchema>_to_<DestinationSchema> [for one-to-one map]
       <SourceSchema1>_and_<SourceSchema2>_to_<DestinationSchema> [for two-to-one map]
           …
If it is possible do not change the schema names in the map name. If the map name is excessive long, cut the schema names, but use the same cut rule for all map names.
6.3        Ports
Ports are the primary artifacts of the BizTalk solution. But in contrast to orchestrations they are used through the BizTalk application boundaries in many places, that is why, we have to use the composite names for the ports like for assemblies.
<Port> =:
            <Solution>.<PortShortName>
Do we need to separate one and two-way ports and send and receive ports, for example be “R_” or “SR_” prefixes? Do they mix up in lookups or in lists? No. And answer to the first question is “No”, do not use prefixes in the port names.
Do we have to use the transport/protocol qualifiers in the port names, like .FILE or .SOAP? No. One port could use several protocols. Moreover port is on the upper level architecture than transport. But for dynamic ports the transport name can be the main part of the port name.
Do we have to use message type in the port names, like .Request? No. One port could work with several message types. But frequently the message type can be used for the port name.
Try to understand the main purpose of the port and use it in the name. For example, link the port name with transport for dynamic port; or link the port name with the partner name, or with message type.
For example, MyCompany.MyDomain.MySolution.MyPartner.
Use the prefixes to differentiate the artifacts in the XLang expressions. These artifacts are not usual .NET objects. They are used in different language context and sometime they use different language syntax. Prefixes really help to work with these artifacts.
<MessageName> =: 
           msg_ + <ShortMessageType>
<VariableName> =: 
           var_ + <Name>
<CorrelationName> =: 
           cor_ + <Name>
<OrchestrationParameter> =: 
           par_ + <Name>
<RoleLink> =: 
           roleLink_ + <Name>
7.2        Orchestration artifact types
 
We can use one suffix the “_type” for all different types because different types are seen only in the different lists and never mixed. For instance, we can never see the port types together with message types.
<ArtifactType> =:
           <ArtifactName> + “_type
<PortName> =: 
           <prefix> + <Name>
where
 
Send port
Receive port
Send-Receive
(Solicit-Response) port
Receive-Send
(Request- Response) port
prefix
S_+
R_+
SR_+
RS_+
 
For example, S_ OrderAck.
Notes:
  • The Port shapes are the real names, the names of the .NET objects. We can’t use spaces inside.
  • In the Orchestration view there are generic lists the “Ports” and the “Port types” that’s why we have to distinguish the ports with different Communication directions and pattern.
7.4        Orchestration Workflow Shapes
Problems with orchestration shapes:
·        Shapes are too small to display long names (only 12-18 characters).
·       We have to “hover mouse over” shape or click shape to show Properties window to "understand" this shape, to understand what message it is processed.
Useful features:
·       Feel free to use the same names for different shapes and use spaces inside the shape names. Shape names are not the “real programming names”. In reality they are the descriptions (excluding the Port shapes names); they are used only for description and for nothing more.
·        Icons on shapes give us the useful information. Do not repeat the “icon information” by words. For example, if we change a name of Construction shape from “Construct Input message” to “Input message” we get more clear definition because we have the Construct icon + name.
·        Shape names are used only in Orchestration Editor (excluding the Port shapes names). We don’t have to force any rules to make the “well-sorted” names (it's the main purpose of the prefixes).
·        Use a Group shape to add description to a group of related workflow shapes. Group shape will display as much text as you want. Group shapes add a lot of documentation value to the orchestration. 
7.4.1          Rules for shapes
Purpose of the orchestration and the most of the shapes is in processing the messages. We can unambiguously describe the messages by the message type. That is why in the most cases using the message type names gives us the main information about this message. That is why in the most cases using the message type names as the shape names gives us the main information about this shape, about message flow, about whole orchestration processing. Send shape with name "OrderAck" means ... exactly!
·        Whenever it is possible use the MessageType of the processed message as a shape name.
·        Do not repeat the type of shape icon by word.
·        Do not repeat words from external shape name into the internal, nested shape name.
·        Feel free to use spaces inside the shape names.
·        Feel free to repeat the shape names.
7.4.2          Rules for specific shapes
Construct, Receive, and Send:
= name of the processed message without “msg_” prefix.
For example, [OrderAck]
Note: it’s easy to set and maintain this name: just copy part of it from Properties/Messages Constructed to Properties/Name. For example, from “msg_OrderAck” copy “OrderAck”
 Transform:
= “from “ + name of the Source message
For example, [from OrderAck]
Note: it’s easy to set and maintain this name: just copy it (or part of it) from Properties/Input Messages to Properties/Name. For example: From “msg_OrderAck” copy “OrderAck”
Assignment:
No strict rules, only advice:
Name it like the methods in classes. But cut a verb if it possible. Use “set” and “get” if it possible.
For example, [set OrderAck]
Consider this chapter as “out-of-scope”. I placed it here because we discussed the folder names here. The files placement is a separate and wealthy topic. Here are only main considerations.
·        If the project is simple, place all files in one project.
·        If we want to use some files for references from other projects, place these files in separate project.
·        Place artifacts to different projects if these artifacts have different refactoring lifecycle. For example, the Niem standard schemas are never changed then place them to the separate project. The maps are changed more frequently than schemas and we could place schemas and maps to the separate projects.
·        Don’t place the technology-specific schemas and maps away from the orchestration they used for. For example, for the SQL port we generate a (technology) schema and usually create the map to transform the original schema to this (technology) schema. Place these schema and map together with orchestration, not into the Schemas/Maps projects.
In the BizTalk project folder add the subfolder the Tests. Use it to the unit tests. Inside the Tests create subfolders: In, Out, TestMessages.
For the BizTalk project with different artifact files you can add the solution folders the Schemas, Orchestrations, and Maps in case you have several schemas, orchestrations, and maps there.              
9        Out of scope
Several BizTalk artifacts are out of scope this naming convention:
·        BRE artifacts: Rule sets, Vocabularies, etc.
·        BAM artifacts: Activities, Views, BAM Definitions, Tracking Profiles
·        Parties, Role links
·        Itineraries from the ESB Toolkit 2.0. I think the ESB Toolkit is a part of BizTalk 2009, because it is delivered in binary format, supported by Microsoft, has a lot of tooling, including Itinerary Designer.
See also
1.      “Naming guidelines for the .NET Framework types” in MSDN [ http://msdn.microsoft.com/en-us/library/xzf533w0(VS.71).aspx ]
2.      “Naming Convention” in Wikipedia [ http://en.wikipedia.org/wiki/Identifier_naming_convention ]
3.      “Abbreviationsin MSDN [http://msdn.microsoft.com/en-us/library/141e06ef(VS.71).aspx ]
4.      “Readability” in Wikipedia [See http://en.wikipedia.org/wiki/Typography ]
5.      “Capitalization Styles” in MSDN  [http://msdn.microsoft.com/en-us/library/x2dbyw72(VS.71).aspx ]
6.      “Assembly Versioning” in MSDN [ http://msdn.microsoft.com/en-us/library/51ket42z.aspx ]
7.      “Namespaces in XML 1.0” [ http://www.w3.org/TR/xml-names/ ]
8.      URN in Wikipedia [ http://en.wikipedia.org/wiki/Uniform_Resource_Name ].
9.      URL in Wikipedia [ http://en.wikipedia.org/wiki/URL ].
 

 
Appendix
Syntax
<Word> =: 
           [A-Za-z1-0]* 
<CompositeWord> =:
           <Word>.<Word>[.<Word>]
<ShortName> :=
           <Word>
           <CompositeWord>
<{Any}ShortName> =: <ShortName>
           [replace {Any} with any term. For example, term Solution creates a <SolutionShortName> term]
<Company> =: <ShortName>
<Domain> =: <ShortName>
<Solution> =:
           <Company>.<Domain>.<SolutionShortName>
<ApplicationName> =: <Solution>
<AssemblyName>  =: <Project>
<Namespace>  =: <Project>
<SolutionsRootFolder> =: c:\Solutions
<SolutionFolder> =:
           <SolutionsRootFolder>\<Solution>
<Project> =:
            <Solution>.<ProjectShortName>
<ProjectFolder> =:
           <SolutionFolder>\<ProjectShortName>
<TargetNamespace> =:
           http://<Domain>.<Company>.com/<SolutionShortName>/<ProjectShortName>/<Version>
<Version> =:
           <date> 
           [in YYYY-MM-DD format]
<Port> =:
            <Solution>.<PortShortName>
<Map> =:
          <SourceSchemaShortName>_to_<DestinationSchemaShortName> [for one-to-one map]
           <SourceSchemaShortName1>_and_<SourceSchemaShortName2>_to_<DestinationSchemaShortName> [for two-to-one map]
Instructions
Keep the names of some BizTalk artifacts in the lists, a list per solution. Create, at last, a list of the XML namespaces of all schemas. Keep them in one list; it forces developers to use naming convention, because inconsistencies in the names are visible inside these lists on the development stage.
1.      Create a new name in the list below.
2.      Copy it to the name property of the new BizTalk artifact.
XML namespace List
Port List
 

Tuesday, July 28, 2009 #

Book “SOA Patterns with BizTalk Server 2009” by Richard Seroter, review
Here is a page from publisher ([PACKT] Publishing)  http://www.packtpub.com/soa-patterns-with-biztalk-server-2009/book
Questions:
Who is the reader of this book? What is the knowledge and experience level of the reader? How good is the book structure?
I think the reader should be a seasoned BizTalk developer. It is not for an entry level developer.
This book is for architects, but for architects with wealthy knowledge of the BizTalk. I would suggest it for a senior BizTalk developers, which is equal to an Integration Architect title.
You can read the first three and the last four chapters of this book only for a quick review of your knowledge.
I highly recommended the chapters from 4th to 7th. They are from Richards’s wealthy experience. They are the heart and soul of the book. I would like to see much more such interesting things, maybe in next edition of this book?
Is it about BizTalk 2009 or about BizTalk?
Chapters from 9th to 12th are about BizTalk 2009 features and tools. Other chapters are more common and do not depend on the last version. They are more than that, better than that.
Is it about SOA Patterns?
Yes, it is.
Is it the “recipe” book?
The book contains a few good recipes, but indeed it is not a recipe book.
Is it the button-to-button book?
No, luckily it is not.
How is the book covering the topics?
Chapter
Audience
Level (1-5)
Grade (1-5)
Chapter 1: Building BizTalk Server 2009 Applications
Architect
Developer
3
1
3
1
Chapter 2: Windows Communication Foundation Primer
Developer
1
1
Chapter 3: Using WCF Services in BizTalk Server 2009
Developer
3
3
Chapter 4: Planning Service-Oriented BizTalk
Architect
3
4
Chapter 5: Schema and Endpoint Patterns
Developer, Architect
3
5
Chapter 6: Asynchronous Communication Patterns
Developer
4
5
Chapter 7: Orchestration Patterns
Developer, Architect
5
3
4
4
Chapter 8: Versioning
Developer
3
3
Chapter 9: New SOA Capabilities in BizTalk Server 2009: WCF SQL Server Adapter
Developer
3
3
Chapter 10: New SOA Capabilities in BizTalk Server 2009: UDDI Services
Developer
3
2
Chapter 11: New SOA Capabilities in BizTalk Server 2009: ESB Guidance 2
Developer
3
3
Chapter 12: What's Next
 
 
 
 
Where Level:
1 – developers with entry level knowledge of BizTalk and no working experience
2 – developers with entry level knowledge of BizTalk and small working experience
3 – developers with fair level knowledge of BizTalk and fair working experience
4 – developers with expert level knowledge of BizTalk and fair working experience
5 – developers with expert level knowledge of BizTalk and expert working experience
I have to say, that several parts of this book “must be read” by every BizTalk developer. I insist these parts MUST be an essential part of the BizTalk Documentation from the early start and it is a shame of Microsoft these chapters are not included in the BizTalk Documentation. For example, the Schema Patterns, Chapter 5, how could developers work with Web-services without basic knowledge about basic principles of serializing schemas to .NET classes?
Sometimes author jumps from really interesting discussions about patterns to examples of how to implement it in “too much details” fashion.
When I ticked on the chapters with 2 or 1 grade, I thought “I cannot find any reason to include this chapter in the book. Here Richard presents only the general information but nothing from his experience. Geners description and general examples, but I would prefer to know the expert opinions, expert arguments, expert views, expert pros and cons.” I understand why these chapters are in the book. However, I strongly believe that the book worth reading if the author express his/her opinions in the text.
For Chapter 11 about ESB I would suggest to see the webcast by Richard Seroter “A look at the ESB Toolkit 2.0 in BizTalk Server 2009http://cloudtv.cloudapp.net/ViewWebcast.aspx?webcastid=2521553277324634479. It is kind of the up-to-date version of this Chapter.
Conclusion
Pros:
“SOA Patterns with BizTalk Server 2009” book contains several very interesting topics.
Book contains an expert point of view.
Book also covers several useful SOA patterns implemented in/with BizTalk Server.
The best part of the book is not only about “how” but about “why” as well.
Cons:
Apparently, the author includes some chapters just to pad the book. But the usable volume is still more than a half. This is good proportion. Yes, it is a good proportion. Usually books of this kind have smaller “performance index”.
Conclusion
This book would be very helpful for the Integration Architects and BizTalk Developers.
Author is one of the most respectful BizTalk experts in the world and his point of view is always interesting.
Must have for every BizTalk Developer.
Highly Recommended
 

Monday, June 29, 2009 #

BizTalk WCF-BasicHttp adapter issue with http://www.w3.org/2001/XMLSchema namespace
 
I am using the WCF-BasicHttp adapter to consume outer Web-service and getting the error (actually if I have retry>0, I am getting Warning first. See below:
 
Event Type: Warning
Event Source: BizTalk Server 2006
Event Category: BizTalk Server 2006
Event ID: 5743
Date:  ...
Time:  ...
User:  ...
Computer: ...
Description:
The adapter failed to transmit message going to send port "..." with URL "...". It will be retransmitted after the retry interval specified for this Send Port. Details:"Unable to read the stream produced by the pipeline.
 Details: The value 'd:date' is invalid according to its schema type 'http://www.w3.org/2001/XMLSchema:QName' - 'd' is an undeclared namespace. ".
...
 
or (After retry the previous message the retry limit for this port)
 
Event Type: Error
Event Source: BizTalk Server 2006
Event Category: BizTalk Server 2006
Event ID: 5754
Date:  ...
Time:  ...
User:  ...
Computer: ...
Description:
A message sent to adapter "FILE" on send port "..." with URI "..." is suspended.
 Error details: Unable to read the stream produced by the pipeline.
 Details: The value 'd:date' is invalid according to its schema type 'http://www.w3.org/2001/XMLSchema:QName' - 'd' is an undeclared namespace. 
 MessageId:  ...
 InstanceID: ...
...
 
Very srange. When I tried the same Web-service with SoapUi, the result of the verification of the Response message is similar.
 
line 8: Invalid xsi:type qname: 'd:string' in element ...@http://...
 
What is wrong with response message?
 
Response Message:

<e:Envelope xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:wn1="..." xmlns:wn2="..." xmlns:wn0="..." xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
   <e:Body>
      <wn2:ActionResponse>
         <wn2:MyResponse i:type="wn2:MyResponseType">
            <wn2:Detail i:nil="true"/>
            <wn2:MyMsg i:type="wn2:ArrayOfMyMsgType">
               <wn2:MyMsgType i:type="wn2:MyMsgType">
                  <wn2:MsgDescriptionText i:type="d:string">...</wn2:MsgDescriptionText>
                  <wn2:MsgIdentificationID i:type="d:string">...</wn2:MsgIdentificationID>
                  <wn2:MsgSeverityLevelCode i:type="wn2:MsgSeverityLevelType">...</wn2:MsgSeverityLevelCode>
                  <wn2:MsgSourceText i:nil="true"/>
               </wn2:MyMsgType>
            </wn2:MyMsg>
         </wn2:MyResponse>
      </wn2:ActionResponse>
   </e:Body>
</e:Envelope>
 
Investigation discovered that the issue is in the namespace prefix "d". If I change it to the "xsd", the error disappeared.
 
Questions:
How to work around this?
Is it the error in the response message?
Is it an error in the WCF-BasicHttp adapter?
 
How to work around this issue?
I changed the WCF-BasicHttp port for the old SOAP port and SOAP port works fine.
 
Is it the error in the response message?
I didn't find any limits for the "http://www.w3.org/2001/XMLSchema" namespace and for prefixes for it. The only limit is "don't use the prefixes, started with 'xml' letters". It is the common practice to use "xsd" prefix for the "http://www.w3.org/2001/XMLSchema" namespace. But it is not the rule.
Seems the WCF-BasicHttp adapter is "too smart".
 
Is it an error in the WCF-BasicHttp adapter?
possible...

Wednesday, April 08, 2009 #

.

BizTalk 2009: notorious Microsoft ADO MD.NET 9.0 and 10.0

 

When I was installing the BizTalk 2009 the Setup asked these prerequisite components:

Microsoft ADO MD.NET 9.0 and

Microsoft ADO MD.NET 10.0

 

I did not have Internet access and I had to manually search for these components.

Seems it is not a simple googling. :)

 

After painful search I've found them here:

1) ADO MD.NET 9.0:

Page "Feature Pack for Microsoft SQL Server 2005 - November 2005" - http://www.microsoft.com/downloads/details.aspx?FamilyID=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en

[- follow PageDown to]

Microsoft ADOMD.NET

...

X86 Package (SQLServer2005_ADOMD.msi) - 3302 KB

X64 Package (SQLServer2005_ADOMD_x64.msi) - 5430 KB

IA64 Package (SQLServer2005_ADOMD_ia64.msi) - 6906 KB

 

2) ADO MD.NET 10:

Page "Microsoft SQL Server 2008 Feature Pack, October 2008" - http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=228de03f-3b5a-428a-923f-58a033d316e1

[- follow PageDown to]

Microsoft ADOMD.NET

...

X86 Package(SQLSERVER2008_ASADOMD10.msi) - 4312 KB

X64 Package (SQLSERVER2008_ASADOMD10.msi) - 9263 KB

IA64 Package(SQLSERVER2008_ASADOMD10.msi) - 6776 KB

 

 

As you can see there is a bad inconsistency in the names!

Hope this article saves you several minutes.


Wednesday, April 01, 2009 #

.
BizTalk: What features we would like to see in future releases
After the MVP Summit [http://geekswithblogs.net/LeonidGaneline/archive/2009/03/09/microsoft-global-summit-mvp-most-valuable-professional-2009-pictures.aspx] we, the BizTalk MVPs, have been asked to give feedback to the product team on what features we’d like to see in future releases.
I created the list of features and separated it into parts. One is from the global, crazy things than never be implemented. But why don’t imagine? Second one is from the small things.
Let start from the big, crazy things:
More flexibility in the deployment and licensing.
What I mean:
1)   Why don't move the BizTalk as a product to cheap segment? (cheap? No, let's talk about bigger)
a)   BizTalk + SQL Express on one box. Then creating a farm of the BizTalk applications would be easier. Load Balancing is moved outside, before the farm. Maybe create a separate product the "BizTalk load balancer"?
b)   Moreover, ship the preconfigured VHD with BizTalk + SQL Express + Windows Server. With possibility to create the farm from these VHDs. (Not so easy because now we have strict limit to the SQL and BizTalk server names, and that limit should be fixed anyway.)
2)   Why don't move to the expensive segment?
a)   Shift to the Windows HPC? What about this? One time the BizTalk was pioneered as the first enterprise level product by Microsoft, created on .NET. Using the HPC methods to get rid of SQL completely, perform all persistency in memory to get super-low latency product.
3)   Reiterate the architecture with all spectrum new Microsoft technologies. Is it possible to extract the MessageEngine, the OrchestrationEngine, and the UnifiedInputOutput Engine to separate products?
4)   At last extract the BRE to separate product or free library! Now it is dead. Give BRE a shock treatment.
5)   Redesign the error processing for different stages of the message processing. Now there are different approaches are used in many places or nothing at all.
6)    Extract the LOB Adapters to separate product on the “buy if you need it” basis or to the free library. Create the Internet store and sell adapters for small money to everyone not only to the buyers of the BizTalk. Sell them not in packages but per adapter.
Now the small things:
Many years there were no improvements in very basic things, the things the developers are using in everyday tasks. I mean: adapters: File, SQL; pipelines; schema and map editors; additional shapes in Orchestrations, etc.
1.      Adapters:
a.    File adapter (for example): add the possibility to use the file names to order delivery (process files in the sorted order, many variations J ); implement the file receive filters with regEx on the file names; add possibility to copy files to other folder after consuming (to make some sort audit/resubmit storage, in forums this question is repeated and repeated, "How we could make a copy of the original files?")
b.    SQL adapter: OMG, there should be many changes in real-time functions and much more improvements in the design-time appearance. I'd prefer to use not the standard Wizard to generate SQL port artifacts but some sort rich-UI window to set up different stages of artifact creation and the real-time parameters.
I am sure the brainstorm by BizTalk MVP should generate a lot of good ideas.
c.      Additional adapters: like Task Scheduler; Nope; Fan-out/Garbage (to consume messages without subscribers in the pub/sub application); PowerShell (for additional processing of the input/output messages). Brainstorm this! Buy these adapters from the third-parts, unify them and include to the standard package.
d.      Please, make InfoPath integration with BizTalk easy as hell!!!! (Isn't it a prime purpose of InfoPath??? To integrate the BizTalk with human?)
2.      Pipelines (pipeline components): where are? the xml <-> PDF ; zip/unzip ; map (yeah! what is wrong with it?); different coders/decoders; symbol (regex) replacement (for EDI processing it MUST be!); PowerShell (for additional processing of the input/output messages); "create message" pipeline; Excel/Word ; Html ; simple EDI (to very basic EDI processing); promote properties from the text; etc. . Brainstorm this!
3.      Add the error processing to the standard interfaces of the custom pipeline components.
4.      Transmitting raw/binary data. Frequently we only use the BizTalk to transfer and route the documents (messages) without transformation. Now it is the second-class citizen scenario.
5.      Orchestrations: additional shapes as: CreateMessage !!!; throwEvent; Pipeline transformation (?).
Make shapes resizable, otherwise we should use odd methods to make the Orchestration more descriptive. How we could show Orchestration to business people if we cannot add enough text to shapes???? Add color to shapes.
Make the Expression Editor window resizable, dockable, fully InteliSensed, etc. !!!!!!!!!!!!!!!!!!
6.      Schema editor: Use the schema node icons for more useful information, definitely, for cardinality (say, different colors for "max occurs = *", for "min occurs = 0"). Maybe add separate window for the referenced (included) schemas?
7.      Map editor: add functoids [IfElse]... Make improvements to the Script functoid!!! Separate to InlineScript; ExternalScript (ExternalMethod?); XsltScript...; make InteliSense to the Inline Script and Xslt script windows. Use the source/target node icons to more usefull information. See http://geekswithblogs.net/LeonidGaneline/archive/2005/12/23/64004.aspx - it is an old list but still actual.
8.      Ports: Please, make ports the first-class artifact as an Orch. Why we should use the orchestration assembly just to store the port type??? Why do we use the "logical port" term in Orchestration editor? It is not a port, it is just an endpoint. Orchestration has the endpoints and the Port has the endpoints. My perception it should be big redesign of the "port part" of the BizTalk architecture. Right now it is a mix of adapters, pipelines, maps, etc. without strict regulation, strict design. This mix is very static, could not be used in structured way to improve the development.

The question to us was: 1) What was/is THE GOOD stuff about the area? 2) What is just plain BAD? 3) What is UGLY about the feature area e.g. if you were developing this feature what would you do to improve it.
I am sorry but I used the same words. To me “UGLY” and “BAD” are just synonyms for ”rudimentary implemented” and “implemented in beta version”.
1)   Monitoring, operations. Now it is UGLY. No real real-time :). See how it works on HPC Windows, for example.
2)   Debugging is plain BAD.
3)   BRE is good, but EVERYTHING for development BR, everything is UGLY.  Development, testing-debugging (come on, have somebody seen the test text window in Composer? the text inside it????), deploying. BRE now is good, very good to sell the BizTalk to business people, and BRE is just pain in ass for developers. Examples?
http://geekswithblogs.net/LeonidGaneline/archive/2006/12/27/102156.aspx
http://geekswithblogs.net/LeonidGaneline/archive/2006/10/16/94245.aspx
Now as a rule of thumb, I use the BRE for POC projects and never for real projects.
4)   To me BAM is kind of partly implemented. Run-time is very good. Design-time is BAD.
5)   ESB. IMHO if the BizTalk gets the Web-service (or metadata) repository, it has ALL ESB functionality and could be named ESB to business people. MVPs discussed this many times on the Summit.
6)   Of course, low latency must be implemented.
 

Monday, March 09, 2009 #

 
Hi All,
I've made pictures on the
Microsoft Global Summit MVP [Most Valuable Professional] 2009 March 1-4, Seattle, Redmond.
Mostly the BizTalk MVPs.
http://public.fotki.com/leogan/cities_and_countries/usa/2009-microsoftgloba/
Steve Ballmer, many vice presidents, Microsoft Fellows, developers from different product teams.
It was fun.
Stephen W. Thomas, Alan Smith, Robert Hogg, Saravana Kumar, Joao Pedro Martins, Ben Cline
Steve Ballmer - Thinker
Microsoft Fellows

Wednesday, October 15, 2008 #

 

Review "MCTS Self-Paced Training Kit (Exam 70-503): Microsoft .NET Framework 3.5 Windows Communication Foundation (PRO-Certification)"

http://www.amazon.com/MCTS-Self-Paced-Training-70-503-PRO-Certification/dp/0735625654/ref=sr_1_12?ie=UTF8&s=books&qid=1224042536&sr=8-12

I like this series of books (SPTK - Self-Paced Training Kit) because the short theory here is always ended with real world examples. And these examples shows how the product is used in the real situations, to solve the real problems. It is like the prioritization of the functionality.

In the WCF documentation on the MSDN there is no such prioritization, great list of the features is here and no clue what are the main features and what are the secondary, additional features.

In the SPTK books there are no place to all features, the goals of these books are different. There are only the main features and steps how they are used to get the real result. For example, the part about MessageContract. A lot of information are in the MSDN, but it is realy hard to understand what the purpose of the MessageContract is. The real world example is shown in this book, how to use the MessageContract to transmit the license key to the client. Short example gives us the understanding of this artifact.

I am working with Web-services more then 4 years, and last year mostly with WCF-services. I was using this book to review my knowledge to make it more systematic. I didn't use this book to prepare for exam ( See discussion about the sertification exams here http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3280207&SiteID=1 )

I use every information source to *understand* what is going on inside the product, why these features were included in the product, what alternatives were and are. Why so? Knowledge does not stucked in my brain without answers to this questions. I could not study the product in the *button-by-button* style as monkey.

I have to know *why*.

Teaching technics usualy use the patterns how the product should not be used, the samples of the improper practice. Usualy it is hard to teach proper technics without list the improper practices. Sometimes one sample of the wrongdoing is worth dozens samples of welldoing.

How does this series of books the SPTK is different from oother books published by Microsoft?

  • Here are only described the *main* product features. These features were selected by Microsoft itself and it works as a unofficial priotirizing. It is very important.
  • Here we see the *real world* problems and ways to resolve them with help of the main product features.
  • In these books are the concisely description (and sometimes the history) what was the *source of these features*.
  • Here we could see the samples of the *improper practice*, how the product should not be used.

 

Pros:

  • This book is the Microsoft vision of what is the intend of the WCF, how the WCF should be used.
  • The concise information about WCF is concentrated in the *Lessons*. The real world samples are placed near it. These samples are also concentrated on the main things.
  • I very like the *Lesson Summary* parts. These lists are the lists of the *prime features* of the WCF.

Cons:

  • Sometimes the book gives us the method in the samples that are obsolete. Say, the generation of the classes from XSD with XSD.exe utility. Several generation of the Software Factory could make this and SvcUtil.exe so.
  • Sometimes the description are not perfect. I have feeling that authors did not squeeze out the whole information from the BizTalk team :) and this is not surprize me because of the huge WCF feature pool. (For instance, we are asked on page.66 to comment attribute the [XmlSerializerFormat...] and regenerate scheams again, then make sure these schemas are going to get big differences from the default schemas. All these exisises with regenerating are useless without detailed explanations.)

 


Conclusion:

I know several good sources of the information about WCF for deep studing.

- and this book is good addition to this list.

I mark this book with 5 stars.

It has flaws, but benefits of using it as a fast and reliable source to study WCF are great.

Best regards!

 




Tuesday, October 14, 2008 #

The WCF has such structure of the performance counter names:
http://msdn.microsoft.com/en-us/library/ms735098.aspx

   ServiceName@ServiceBaseAddress
  (ServiceName).(ContractName)@(endpoint listener address)
  (ServiceName).(ContractName).(OperationName)@(first endpoint listener address)

In MSDN we have:
"There is a limit on the length of a performance counter instance's name. When a Windows Communication Foundation (WCF) counter instance name exceeds the maximum length, WCF replaces a portion of the instance name with a hash value."  http://msdn.microsoft.com/en-us/library/ms731052.aspx


In my case WCF has generated the names:

  notif28.inoti60.removebyrefer54@82rapper|notificationwrapper.svc
  notif28.inoti60.removebymsgid@82rapper|notificationwrapper.svc
  notif28.inoti60.removebyemailid@82rapper|notificationwrapper.svc
  notif28.inoti60.schedule@82rapper|notificationwrapper.svc

(Sorry for rapper :) Originally it was Wrapper)

The question is:
Can I use these names as hard-coded names or
next time the WCF could generate different names???
BTW Such names with a hash value are disaster if I need to use the performance counters in my code.

Say I'd like to get counters for the operation with name "RemoveByReferenceMessage" name.
How I can find my counters with code if I have names:
notif28.inoti60.removebyrefer54@82rapper|notificationwrapper.svc
notif28.inoti60.removebymsgid@82rapper|notificationwrapper.svc
notif28.inoti60.removebyemailid@82rapper|notificationwrapper.svc
notif28.inoti60.schedule@82rapper|notificationwrapper.svc


???
How many chars of the operation name I have to use for search?
How many chars of the endpoint name I have to use for search?
How many chars of the service name I have to use for search?
One good part of this is that is the hash algorithm always gives us the same names. Al last in my experience.
Now I know only one method to use WCF performance counter names in the custom code:
  1. Start WCF service and get the generated performance counter names from the PerfMon.
  2. Use these names in the code.
Disadvantages: After any change in the ServiceName, ContractName, OperationName, ServiceBaseAddress, EndpointListenerAddress we have to repeat these steps again.



Thursday, October 09, 2008 #

Sometimes in the BizTalk forums such questions appear.
"...I have been using event log to test variables. I was hoping there was a way to watch it process in VS like you can debug a forms app."

There is a difference in the usual app and in the "BizTalk app".
When you start usual app it is exactly this app and you could debug it. When you "start" the BizTalk app that could means *many* *instances* of this BizTalk app could works simultaneously.
With BizTalk you have an intermediate layer, the host. This host (actually it is a host instance but it doesn't matter for this case) manages the app *instances*. It could start many app instances simultaneously and then dehydrate, rehydrate, stop, abort them without our intervention.
Ideally we need to attach a debugger to exactly one app instance (which one?) or create a debugger working with many app instances simultaneously.
It is one of the source of the complexity of debugging the BizTalk apps.
BTW What is a BizTalk application at all?

Please, let me know, what do you think.


Wednesday, October 08, 2008 #

Hello,
 
Before Dublin is in charge, especially the Repository for the Web-services I'm using the custom code to manage the buzz  with many URLs in Web.config files
 
There is a utility to change all URLs in .config files by one click.
http://www.codeplex.com/FilesModificatorAdmi

 
1. Purpose.
In my current project we've got a lot of composite WCF-services. We have several environments: Development,Test1, Test2, Production.
We don't have the service repository. That means when we move the services from one environment to another, we have to change addresses (URLs) in the <client> sections of all Web.config files (several dozens). Boring and error prone work, isn't it?
 
The FilesModificatorAdmin utility was created to change all addresses in all Web.config files by one click.
 

2. How it works.
We define the files that should be scanned and changed. We define the root folder for search. We define the replacements substrings like "http://Env1.MyCompany.com/Composite/Promo/PromoService.svc". The utility derives the searching substring RegExes from the replacement substrings like ""http[^\"]*?PromoService.svc".
 
Then the FilesModificatorAdmin utility scans all defined files in all folder tree and replace the substrings.
Utility creates the copy of the changed files as OldName.copy.
Utility output the progress to the screen and optionally to the log file.
Utility could optionally just scan the files and show how many searching substrings were found and where.
 

3. Notes.
 * The rules to derive the RegEx for the search are hard coded.
 * If the FilesModificatorAdmin found the searching substrings but the string does not changed (it is possible because the searching sub string RegEx could find the substring that is equal the replacement substring) the FilesModificatorAdmin does not change the substring. In this case it shows that sub strings were found if option the "find only and do not replace the Substrings" is checked, and it shows that substrings were not found if option the "find only and do not replace the Substrings" is unchecked.
 


GLD (C) 2008

Tuesday, September 02, 2008 #

There is an interesting discussion "BizTalk, From Hub/Spoke to ESB" in the MSDN BizTalk forum: [http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3478379&SiteID=1]


Thursday, July 10, 2008 #

 This is a Part 4 of the Interview articles.
Part 1: "BizTalk 2004, Questions for interview without answers" http://geekswithblogs.net/LeonidGaneline/archive/2006/05/22/79267.aspx  
Part 2: "BizTalk interview questions and principle" http://geekswithblogs.net/LeonidGaneline/archive/2007/07/03/113663.aspx
Part 3: "WCF: Questions for studing and interview" http://geekswithblogs.net/LeonidGaneline/archive/2008/01/07/wcf-questions-for-studing-and-interview.aspx  
 

Please, mark your skills in the table. 
I completely understand that nobody ever tried ALL the BizTalk features.    
   
Name                                                      Number of the Projects      Months             Skills Mark (1..10 or A,B...)


artifacts:
applications   
ports, groups, locations   
FTP   
SOAP
WCF   
HTTP   
SQL   
WCF   
SMTP, POP3   
MSMQ   
SharePoint   
LOB: EDI base, Siebel, etc. (name them)   
pipelines
pipeline components   
schemas   
maps   
database functoids (or custom DB mapping)   
Xslt   
Xslt templates   
orchestrations   
transactions   
atomic scopes  
long-running   
compensation scopes    
exception scopes     
persistent points   
correlations   
helper .NET classes   
SQL data bases (with relation to the BizTalk)   
hosts, instances   
adapters   
parties   
EDI, AS2 system   
policy, rules, vacabularies   
BAM
ESB Toolkit   
BAS 
Development: 
orchestrations   
port-to-port   
helper .NET classes   
custom adapters   
custom pipeline components   
custom functoids   
rules…   
BAM   
BAS   
ESB  
 Debugging Tuning-Up:   
VS
Nunit   
BizUnit   
LoadGen 
SoapUI  
stress testing   
performance metrics   
different utilities (name them)   
multi-server debugging   
MOM   
HAT   
Adm.Console   
PerfMon   
 
Deployment: 
MSBuild
BTSDeploy   
BTSTask   
MSI, Binding   
multi-server deployment   
clustered MessageBox   
WMI scripts  
   
Development techniques:   
   - correlation   
   - convoy parallel   
   - convoy sequential unified   
   - convoy sequential non unified   
   - long-running transaction   
   - transaction compensation   
  - FIFO   
   - send data to SQL   
   - receive data from SQL   
   - data validating   
 - error handling in the BizTalk applications   
  - BizTalk to/from WS/HTTP apps   
* test-driven development   
* .NET development tools   
   
Programming skills:   
* test-driven programming   
* VS.NET   
* script languages, utils   
* SQL: database normalization, programming   
 Web-programming   
low-end programming   
   
 
   
 

   
Several questions (sorry, no more than 2-3 min for answer):
 
  • How do you study BizTalk? what are the main sources of the information? 
  •  Describe creating the full-featured BizTalk application. Just the steps.   
  • Describe debugging the full-featured BizTalk application.   
  • Describe deploying the full-featured BizTalk application.   
  • Monitoring the BizTalk application:   
       


   
Skills Mark Legend:   
 can describe purpose and functionality 
 2 made Sample(s) 
 3 used in one project 
 used in one project recently  
 used in several projects 
 6 used advanced functionality 
 can show my answers in forums and articles in blog 
 8 used API (in code) 
 9 can teach other developers, can show pro and cons 
                 OR  
 A know something 
 B can use in standard cases 
 C can use advanced features, API 
 expert 
 


Wednesday, July 09, 2008 #

Interesting information in KB:
"How to use distinguished fields and promoted properties in a BizTalk Server project" http://support.microsoft.com/kb/942250
 
"...
  • A promoted property may not be available as a promoted property after you write a value into the message context. This situation can occur if the value that you write into the message context has the same name and namespace that was used to promote the property.
  • Properties that have a null value are not permitted in the message context. Therefore, if a null value is written into the message context, this value will be deleted.
    ..."
 
BTW What is it "a null value"?
  • Is it <shipDate xsi:nil="true"></shipDate> ?
  • Is it absence of the value <shipDate></shipDate> ?
  • Is it "closed tag <shipDate /> ?
  • Is it absence of the whole node?
 
In http://www.w3.org/TR/2004/REC-xmlschema-0-20041028/#Nils we have description of it. But frequently we've got different interpretation of this term. And I am not sure about interpretation in KB
 
 
And let me add one more, not obvious:
  • Distinguished fields and promoted properties have to always get Min/Max Occurs = 1. (Not 0, not "unbounded", only 1)

Tuesday, June 24, 2008 #

Notes

·         Bindings are spread across several namespaces.

·        DataContractAttribute is placed in the System.Runtime.Serialization namespace not in the System.ServiceModel namespace.

·         Configuration sections are spread across several namespaces.

·         ClientSection and ServicesSection: First has the structure client/endpoint, the second – services/service/endpoint. Asymmetric.


System.ServiceModel.dll

System.ServiceModel

·         ServiceHost

·         ChannelFactory<TChannel>

·         ClientBase<TChannel>

Contracts:

·         ServiceContractAttribute

·         OperationContractAttribute

·         MessageContractAttribute

·         FaultContractAttribute

Bindings:

·         BasicHttpBinding

·         NetMsmqBinding

·         NetNamedPipeBinding

·         NetPeerTcpBinding

·         NetTcpBinding

·         WS2007FederationHttpBinding

·         WS2007HttpBinding

·         WSDualHttpBinding

·         WSFederationHttpBinding

·         WSHttpBinding

Exceptions:

·         CommunicationException

·        

 

System.ServiceModel.Activation

·         ServiceHostFactory

·         WorkflowServiceHostFactory

System.ServiceModel.Activation.Configuration

·         DiagnosticSection

System.ServiceModel.Channels

Interfaces:

·         IChannel

·         IChannelFactory<TChannel>

·         IChannelListener<TChannel>

Abstract classes:

·         Binding

·         BindingContext

·         BindingElement

·         ChannelFactoryBase<TChannel>

·         ChannelListenerBase<TChannel>

·         CommunicationObject

·         Message

·         MessageHeader

·        

Bindings:

·         CustomBinding

Binding Elements:

·         TransportBindingElement

·         MessageEncodingBindingElement

·        

System.ServiceModel.Configuration

Sections:

·         BehaviorsSection

·         BindingsSection

·         ClientSection

·         DiagnosticSection

·         ServicesSection

Element: System.Configuration.ConfigurationElement

·         BaseAddressElement

·        

ElementCollection: System.ServiceModel.Configuration.ServiceModelEnhancedConfigurationElementCollection<ComMethodElement>

·         BaseAddressElementCollection

·        

System.ServiceModel.Description

·         ServiceEndpoint

Behavior interfaces:

·         IContractBehavior

·         IEndpointBehavior

·         IOperationBehavior

·         IServiceBehavior

Descriptions:

·         ContractDescription

·         FaultDescription

·         ServiceDescription

System.ServiceModel.Dispatcher

·         ChannelDispatcher

*     ClientOperation

*     ClientRuntime

·         EndpointDispatcher

Filters:

·         ActionMessageFilter

·         MatchAllMessageFilter

·         MessageFilter

·        

System.ServiceModel.MsmqIntegration

·         MsmqIntegrationBinding

System.ServiceModel.Security

Credentials:

Encoders:

System.ServiceModel.Security.Tokens

Tokens:

SecurityTokenParameters:


System.Runtime.Serialization.dll

System.Runtime.Serialization

Attributes:

·         CollectionDataContractAttribute

·         DataContractAttribute

·         DataMemberAttribute

·         EnumMemberAttribute

 

 

System.WorkflowServices.dll (v3.5)

System.ServiceModel

·         WorkflowServiceHost

Bindings:

·         BasicHttpContextBinding

·         NetTcpContextBinding

·         WSHttpContextBinding

 

 




Thursday, June 19, 2008 #

We should install the certificate to the server that hosts the services with Transport level security.

For tests we could use the self-made certificate, for production we recommend to use the certificate issued by the industrial certificate provider as the VeriSign.

1.       Install Microsoft .NET Framework 2.0 Software Development Kit (SDK) (x64) [http://www.microsoft.com/downloads/details.aspx?familyid=1AEF6FCE-6E06-4B66-AFE4-9AAD3C835D3D&displaylang=en]. It is installed by default to the "C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\Bin " folder.

2.       [Optionally, only if you also have server certificate and want to refresh it]"C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\Bin\certmgr.exe" -del -r LocalMachine -s My -c -n MyCompany-HTTPS-Server

3.       "C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\Bin\makecert.exe" -sr LocalMachine -ss My -n CN= MyCompany-HTTPS-Server -sky exchange -sk MyCompany-HTTPS-Key

4.       Install the new certificate to the IIS by the Web Server Certificate Wizard. Open IIS Admin, choose the Web-site, Properties, Directory Security tab, Secure communicationServer Certificate… button, it starts the Web Server Certificate Wizard .

5. Check if the IIS / Web Site / Properties / tab Web Site - SSL Port set up to 443 (

 


To expose the service metadata by HTTPS and HTTP use:

    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior_Name">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

To expose the service metadata by HTTPS or HTTP only, change attribute the httpsGetEnabled or httpGetEnabled to false.



Monday, June 02, 2008 #

After creating simple WCF service I've got strange errors (see below).
 
The issue was in the names of the response messages.
I used the simple custom rule to name request and response messages (.NET DataContract classes):
<OperationName>Request and <OperationName>Response
For instance I created GetTokenResponse class for the response message of the GetToken operation.
 
And this is the wrong rule!
Why? Because the WCF creates these names for the WSDL metadata files:
 
For instance I've got:
...
<wsdl:message name="ITokenStore_GetToken_OutputMessage">
  <wsdl:part name="parameters" element="tns:GetTokenResponse" /> ...
 
....<wsdl:operation name="GetToken">
  <wsdl:input wsaw:Action=http://MyServices/TokenStore/2008-05-29/ITokenStore/GetToken message="tns:ITokenStore_GetToken_InputMessage" />
  <wsdl:output wsaw:Action=http://MyServices/TokenStore/2008-05-29/ITokenStore/GetTokenResponse message="tns:ITokenStore_GetToken_OutputMessage" />
 
 
When I changed the name to the GetToken_Response the errors disappeared.
It is not an error in the WCF it is just undocumented feature.
The problem is the error text gives us unhelpful and ambiguous information.
 
See the article in MSDN: http://msdn.microsoft.com/en-us/library/ms731045.aspx
Not a clue about these rules.
Conclusion:
Don't use the messages names with suffixes Response, Solicit, Request.
Don't use the name convention for the request and response messages (.NET classes) like <OperationName>Request and <OperationName>Response !
 
ADDITION [2009-07-26]: This behavior is because of the WSDL standard.
See http://www.w3.org/TR/wsdl
"

2.4.5 Names of Elements within an Operation

The name attribute of the input and output elements provides a unique name among all input and output elements within the enclosing port type.

In order to avoid having to name each input and output element within an operation, WSDL provides some default values based on the operation name. If the name attribute is not specified on a one-way or notification message, it defaults to the name of the operation. If the name attribute is not specified on the input or output messages of a request-response or solicit-response operation, the name defaults to the name of the operation with "Request"/"Solicit" or "Response" appended, respectively.

"

Error in SoapUI
, when we've tried to get the metadata:
... ERROR:javax.wsdl.WSDLException: WSDLException (at /HTML): faultCode=INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}definitions'.
 

Error in IE: by address the <ServiceAddressURL>

The service encountered an error.

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: System.ServiceModel.Description.DataContractSerializerOperationBehavior
 contract: http://MyServices/TokenStore/2008-05-29:ITokenStore ----> System.Xml.Schema.XmlSchemaException: The global element 'http://MyServices/TokenStore/2008-05-29:GetTokenResponse' has already been declared.
   at System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e)
   at System.Xml.Schema.BaseProcessor.AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item)
   at System.Xml.Schema.Preprocessor.Preprocess(XmlSchema schema, String targetNamespace, ArrayList imports)
   at System.Xml.Schema.Preprocessor.Execute(XmlSchema schema, String targetNamespace, Boolean loadExternals)
   at System.Xml.Schema.XmlSchemaSet.PreprocessSchema(XmlSchema& schema, String targetNamespace)
   at System.Xml.Schema.XmlSchemaSet.Reprocess(XmlSchema schema)
   at System.ServiceModel.Description.MessageContractExporter.Compile()
   at System.ServiceModel.Description.DataContractSerializerMessageContractExporter.Compile()
   at System.ServiceModel.Description.MessageContractExporter.ExportMessage(Int32 messageIndex, Object state)
   at System.ServiceModel.Description.MessageContractExporter.ExportMessageContract()
   at System.ServiceModel.Description.WsdlExporter.CallExtension(WsdlContractConversionContext contractContext, IWsdlExportExtension extension)
   --- End of inner ExceptionDetail stack trace ---
   at System.ServiceModel.Description.ServiceMetadataBehavior.MetadataExtensionInitializer.GenerateMetadata()
   at System.ServiceModel.Description.ServiceMetadataExtension.EnsureInitialized()
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.InitializationData.InitializeFrom(ServiceMetadataExtension extension)
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.GetInitData()
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.TryHandleDocumentationRequest(Message httpGetRequest, String[] queries, Message& replyMessage)
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.ProcessHttpRequest(Message httpGetRequest)
   at SyncInvokeGet(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

Error in IE: by address the <ServiceAddressURL>?wsdl

The service encountered an error.

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: System.ServiceModel.Description.DataContractSerializerOperationBehavior
 contract: http://MyServices/TokenStore/2008-05-29:ITokenStore ----> System.Xml.Schema.XmlSchemaException: The global element 'http://MyServices/TokenStore/2008-05-29:GetTokenResponse' has already been declared.
   at System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e)
   at System.Xml.Schema.BaseProcessor.AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item)
   at System.Xml.Schema.Preprocessor.Preprocess(XmlSchema schema, String targetNamespace, ArrayList imports)
   at System.Xml.Schema.Preprocessor.Execute(XmlSchema schema, String targetNamespace, Boolean loadExternals)
   at System.Xml.Schema.XmlSchemaSet.PreprocessSchema(XmlSchema& schema, String targetNamespace)
   at System.Xml.Schema.XmlSchemaSet.Reprocess(XmlSchema schema)
   at System.ServiceModel.Description.MessageContractExporter.Compile()
   at System.ServiceModel.Description.DataContractSerializerMessageContractExporter.Compile()
   at System.ServiceModel.Description.MessageContractExporter.ExportMessage(Int32 messageIndex, Object state)
   at System.ServiceModel.Description.MessageContractExporter.ExportMessageContract()
   at System.ServiceModel.Description.WsdlExporter.CallExtension(WsdlContractConversionContext contractContext, IWsdlExportExtension extension)
   --- End of inner ExceptionDetail stack trace ---
   at System.ServiceModel.Description.ServiceMetadataBehavior.MetadataExtensionInitializer.GenerateMetadata()
   at System.ServiceModel.Description.ServiceMetadataExtension.EnsureInitialized()
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.InitializationData.InitializeFrom(ServiceMetadataExtension extension)
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.GetInitData()
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.TryHandleMetadataRequest(Message httpGetRequest, String[] queries, Message& replyMessage)
   at System.ServiceModel.Description.ServiceMetadataExtension.HttpGetImpl.ProcessHttpRequest(Message httpGetRequest)
   at SyncInvokeGet(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)