This Assembler cannot retrieve a document specification

 

The most common cause of following errors are if same schema deployed multiple time in BizTalk. Sometimes this is desirable behavior, for example, if same schema is shared by two different BizTalk application.

Since BizTalk applications are just logical grouping of BizTalk artifacts, schemas deployed for one application will be visible to other applications and might create this type conflict.

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

There was a failure executing the send pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLTransmit, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML assembler" Send Port: "PCISendPort" URI: "oracledb://x:1521/X/Dedicated" Reason: This Assembler cannot retrieve a document specification using this type: http://Microsoft.LobServices.OracleDB/2007/03/PC/Package/STORED_PROCEDURES_2#STOP_LIST

There was a failure executing the response(receive) pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Send Port: "PCISendPort" URI: "oracledb://x:1521/PCI/Dedicated" Reason: Cannot locate document specification because multiple schemas matched the message type http://Microsoft.LobServices.OracleDB/2007/03/PC/Package/STORED_PROCEDURES_2#STOP_LISTResponse.

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

Solution:

Create a new send port for service, go to send pipeline properties and set DocumentSpecNames property to fully qualified name of schema in format <schema type>+<root name> ,<schema assembly full name>. This Pipeline property tells BizTalk exact location of schema to be loaded and thus avoid conflict

for example: ReportLostV2.CardReportLostPC_Package_STORED_PROCEDURES_2+STOP_LIST, Card.ReportLostV2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9b51853b6987xxxx

 

SNAGHTML5cba62b

 

you can get DocumentSpecNames value from SchemStrongName context property.

SNAGHTML5d11072

Posted in BizTalk. 1 Comment »

.NET Integration with HSM

Recently had a scenario where we need to encrypt Card PIN code with keys provided by HSM. In our case, HSM was using TripleDES symmetric key algorithm for encryption and decryption. First, I tried with .NET Framework TripleDESCryptoServiceProvider, but that was not working.

After lots of trial and error, the solution was using Thales Simulator Library. Following is sample code for encrypting PIN with ZPK (Zone Private Key). ZPK was communicated between parties in encrypted format and we need to decrypt it first using ZMK (Zone Master key)

 

public static string GetEncryptedPINwithZPK(string CardNumber, string PIN)
{

         HexKey key = new HexKey("ZMK");
         string ZPK = ThalesSim.Core.Cryptography.TripleDES.TripleDESDecrypt(key, "EncryptedZPK");

         string PINBlock1 = ("0" + PIN.Length + PIN).PadRight(16, 'F');
         string CNumber = CardNumber.Substring(0, CardNumber.Length - 1); // to skip right most check digit
         string PINBlock2 = "0000" + CNumber.Substring(CNumber.Length - 12);

         HexKey ZPKHex = new HexKey(ZPK);
         string EncryptedPIN =  ThalesSim.Core.Cryptography.TripleDES.TripleDESEncrypt(ZPKHex, XORStrings(PINBlock1, PINBlock2));

         return EncryptedPIN;
}
Posted in BizTalk, C#. 1 Comment »

BizTalk: System.InvalidCastException

 

I was facing a strange runtime error when calling a BizTalk Orchestration dynamically from another Orchestration. (Dynamic Call Orchestration is not supported out of the box, so we have a custom implementation for that).

Error:

System.InvalidCastException: Unable to cast object of type ‘Microsoft.XLANGs.Core.MessageTuple’ to type ‘Microsoft.XLANGs.Core.XMessage’

Reason:

Apparently, when creating Orchestration message parameters, the VS misinterprets the order of parameters. So we need to verify order and direction (In/Out/Ref) of the parameters inside Orchestration’s auto generated code & designer’s XML

    body (message <Type> Rq, out message <Type> Rs)

We can correct it manually, or delete all code after #endif // __DESIGNER_DATA and reopen Orchestration and modify anything there to regenerate the code.

BizTalk Orchestration does not appear after deployment

I had a weird scenario where Orchestration was not appearing in BizTalk Administration Console after deployment through Resources > Add BizTalk Assemblies

The reason was the following missing entry in AssemblyInfo.cs. Actually the project template was copied from another BizTalk project and AssemblyInfo.cs was removed during the process. When we set assembly properties, VS generates the AssemblyInfo.cs but missed the following entry required for BizTalk assemblies

using Microsoft.XLANGs.BaseTypes;
using Microsoft.BizTalk.XLANGs.BTXEngine;

[assembly: Microsoft.XLANGs.BaseTypes.BizTalkAssemblyAttribute(typeof(BTXService))]

When tried to deploy the project from VS, its give the following error which hints about the actual issue

Assembly does not appear to be a BizTalk assembly, and cannot be deployed to the Configuration
database.

Software Development – Design Concepts

 

I was going though scott hanselman’s post on Interview Questions and found some concepts that are new/interesting for me. posting here for my reference

SOLID (in context of Object Oriented Design)

S: Single responsibility

every object should have single responsibility. Easier to change code with minimum side effects

O: Open/closed

open for extension, but closed for modification. provides backward compatibility when extending the functionality

L: Liskov substitution

objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program

I:Interface segregation

many client specific interfaces are better than one general purpose interface. No client should be forced to depend on methods it does not use. Easy to change code, faster deployment when interface for only one client is changed

D: Dependency inversion

High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend upon details. Details should depend upon abstractions. advantage is loose coupling

Concurrency Control

Optimistic approach assumes that multiple transactions can complete without affecting each other and transactions  proceed without locking. Just before committing, each transaction verifies that no other transaction has modified its data. If the check reveals conflicting modifications, the committing transaction rolls back. Used in environments with low data contention.
In Pessimistic concurrency control, a transaction puts a lock before reading/writing and thus prevents other transactions to update the same data. suitable for high data contention scenarios

Posted in C#. Tags: . Leave a Comment »

Convincer Strategy

 

A Convincer Strategy is how a person comes to believe something to be true.

For some people, they need to see it with their own eyes.  For others, they need to hear something multiple times from multiple people before they believe it

The convincer strategy has two parts.

1. Figure out what convinces someone, what inputs he needs to become convinced.

e.g. How you believe that someone is good at job? You may believe someone’s good when you see him doing a good job and when other people tell you he’s good

2. Discover how often he has to receive these stimuli before becoming convinced, e.g. heard once, multiple times, multiple sources or he might need continuous stimuli. Repeating the same concept multiple times helps in convincing

 

[via Sources of Insight]

0xC0002A21 – SSO Configuration Failed

 

I was trying to configure BizTalk Server 2009 with SQL Server 2008 SP1, SSO configuration throws the following error:

(0xC0002A21) An error occurred while attempting to access the SSO database.  (SSO)
SQL: 0x00000FDC: Cannot open database "SSODB" requested by the login. The login failed. Login failed for user…

One odd reason of this exception is an old SSO database file in the database folder

‘C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA’

This prevents the creation of SSO DB because a database file already exists at the same path. To resolve, just delete the old SSODB.mdf and SSODB.ldf files

Utility vs Strategic Projects

 

A Utility project is where underlying business process is not the differentiator, e.g. Payroll process, every company want it but a better payroll process does not give your business edge over your competition.

The way you staff, run, and budget a strategic project is entirely different to how you do a utility project. For utility projects the biggest risk is some kind of catastrophic error – you don’t want to miss payroll. So you need enough attention to make sure that doesn’t happen, but other than that you want costs to be as low as possible.

However with strategic projects, the biggest risk is not doing something before your competitors do. So you need to be able to react quickly. Cost is much less of an issue because the opportunity cost of not doing something is far greater than costs of software development itself. Usually only 5-10 percent of projects are of strategic type.

Since the definition of utility is that there’s no differentiator, the obvious thing is to go with the package. For a strategic function you don’t want the same software as your competitors because that would cripple your ability to differentiate. Often people realize this and buy a package for a utility project, but then spend huge amounts of money customizing this – which is just as wasteful. My view is that for a utility function you buy the package and adjust your business process to match the software. Usually this is politically infeasible, so the workaround is to put a low grade software team to work on it, provide enough care to avoid catastrophe.

[via Martin Fowler]

BizTalk Error: 0xc0c0153a

 

we have following error in windows log when we try to start 64-bit BizTalk host instance.

(BizTalk Server 2009, SQL Server 2008, Windows Server 2008 R2)

Faulting application name: BTSNTSvc64.exe, version: 3.8.368.0, time stamp: 0x49b1f793
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdfe0
Exception code: 0xe0434f4d
Fault offset: 0x000000000000aa7d
Faulting process id: 0x1d08
Faulting application start time: 0x01cb1dca422e30ab
Faulting application path: E:\Program Files (x86)\Microsoft BizTalk Server 2009\BTSNTSvc64.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 803103c0-89bd-11df-9a1c-e41f131a4842
Service request: Start
BizTalk host name: BizTalkServerApplication
Windows service name: BTSSvc$BizTalkServerApplication
Additional error information:
Error code: 0xc0c0153a
Error source: BizTalk Server 2009
Error description: A BizTalk subservice has failed while executing a service request.
Subservice: Tracking
Service request: Start
Additional error information:
Error code: 0×80131534
Error source: System.Data
Error description: The type initializer for ‘System.Data.SqlClient.SqlConnection’ threw an exception.

After lots of troubleshooting, the apparent reason for this error is missing SP1 installation for SQL Server 2008.

SQL Server 2008 have compatibility issues with windows server 2008 R2 and SQL Setup points this out during the installation

image

Maturity Level of Software Teams

 

  • A software team can be at one of the following maturity levels:
  • Chaotic Stage – the state where a team does not posses the skills, motives or vision to become a mature self managing team.
  • Mid-Life stage – where a team possesses some skills for self management and decision making , and can make some of its own decisions without needing a team lead.
  • Mature stage – where a team is practically fully self managing and a team leader is mostly a coach rather than a decision maker.

The chaotic stage needs a strong, dictator like leadership – to bring much needed peace to a team that might be mostly struggling to keep its head above water all day long. A dictator team lead is there in the first stage, to bring the team up to a specific state, where they also have the time and patience to learn new things.

The Mid-Life stage needs a coach-dictator – where a team will learn the skills needed to become self managing.For example, the team lead teach the team to do its own code review so that the team lead is no longer the bottleneck, and so that the team learns essential skills for code quality and decision making.

The Mature stage needs a coach – just to help them to grow, to teach them new skills.

[via Mark Needham]

Follow

Get every new post delivered to your Inbox.