Thursday, May 23, 2013

C++/CLI library in BizTalk component

For a BizTalk project I needed to decrypt a password stored in a database that was encrypted using a legacy unmanaged C++ Blowfish static library. In attempting to write a C# blowfish decrypter, it was discovered that the Blowfish library wasn't really a 'true' implementation of Blowfish. Since redoing the encryption was not an option due to many factors, I decided to write a managed C++/CLI wrapper class of the static libraries. Using this as a guide (http://tom-shelton.net/?p=95), I went about creating the wrapper class. Most of the challenges of getting the wrapper class to work revolved around matching data structures between the managed and unmanaged code. Special care should be taken to clean up any unmanaged objects.

A pipeline component was created that made the database lookup, decrypted the password using the wrapper class and inserted the password into the outgoing message. To use the wrapper dll, it needed to be strong named. I'm sure there is probably a way to do that in a post-build command, but I did it manually using
 sn -Rca //pathtodll keycontainer  
The dll needs to be gaced into the 32 bit Global Assembly Cache. Any BizTalk host that uses the pipeline component should be checked 32-bit only.

Thursday, May 2, 2013

Biztalk retry pattern, deliver notification

I have a BizTalk orchestration that uses a retry pattern. After a code review, it was noticed that the failing ports should have delivery notification set to transmitted. Otherwise, there is a chance that on a restart, the send message could be resumed before the orchestartion. This would cause two messages. Here are some links describing the retry pattern and delivery notification:



Thursday, March 21, 2013

Multi-Part Map instance

Testing a debugging a multi-part map in BizTalk 2010 can be a pain. There is no way to easily create an instance of an aggregate schema. This post shows a way to create an aggregate instance by inverting the map:

http://allcomputers.us/windows_server/biztalk-2010-recipes---document-mapping---testing-maps.aspx

Friday, March 15, 2013

Orchestration design disappeared

I opened a BizTalk 2010 orchestration file in the xml editor in Visual Studio 2010. When I tried to get back to the design view, it insisted on opening in xml. I found this blog posting that gave me the solution:

http://blog.tallan.com/2012/06/05/biztalk-orchestration-fails-to-open-in-design-view/


P.S.: I think this is my second solution from blog.tallan.com. I might have to bookmark them.

Monday, January 28, 2013

Adding an installer to a Windows Service

This link was instrumental in helping me add a stand-alone installer to a windows service. Since I was using a service derived from an abstract base service class, I found it easier to do the steps to create the installer and then change the base class.

http://blog.tallan.com/2009/06/01/creating-a-project-installer-for-a-windows-service/

Monday, January 21, 2013

Windows Service Debugging

Debugging windows services in Visual Studio 2010 can be a royal pain in the ass! Particularly trying to set a breakpoint in the OnStart() method. After trying many methods, I found this:

http://www.codeproject.com/Articles/20458/Debugging-OnStart-Method-in-NET-Service-when-Debbu


The only downside I discovered is that you must always start debugging the service when it is started, otherwise it will continually wait for a debugger session and timeout. Once you stop debugging, the service continues running.


Friday, January 4, 2013

BizTalk Looping functoid

Excellent article on using the table looping and table extractor functoids in BizTalk mapper.


http://hestia.typepad.com/flatlander/2007/01/mapping_fixed_e.html