NUnit Developer

Alright, so it’s a bit of boasting on myself but I’m happy to say that officially as of yesterday I’ve been added as a Developer on NUnit.
If you know me, you know I believe firmly in Test Driven Development and I’ve been
contributing for some time now to the NUnit project. Well Charlie
Pool extended the offer and I’ve accepted the position to become a Developer on
the project officially. What does it change? Very little, I’ll still be writing code
for this great tool just like I was before this but it does make me feel like my contributions
to the project have been of a high quality and that people appreciate the time I’ve
dedicated to it.

Excel File Schema Wizard


Jeff has written a recent article on showing how to use the new FarPoint XLS File Pipeline Component to create a an XML schema from an existing Excel file. I have been looking for something like this for quite sometime. Since Excel has been used as a defacto standard in many companies, I hope this would be of great help for many integrations.


From the Screenshots Jeff has posted it looks mostly like a Flat File Schema wizard. Check it out here

Cumulative Sum inside a loop in Biztalk Mapper

One of my blog reader asked my help to resolve a mapping to find a cumulative sum inside an existing Loop. The Source Xml Structure is as follows


<Details>



<Detail>



<Code>1</Code>


<Amount>200</Amount>


</Detail>


<Detail>



<Code>2</Code>


<Amount>1200</Amount>


</Detail>


<Detail>



<Code>1</Code>


<Amount>200</Amount>


</Detail>


</Details>


The Expected result is as follows. If you see the Amount has to be added for the same <Code> values.


<Details>



<Detail>



<Code>1</Code>


<Amount>400</Amount>


</Detail>


<Detail>



<Code>2</Code>


<Amount>1200</Amount>


</Detail>


</Details>


Even though this appears to be simple, it’s quite hard to do this inside Biztalk mapper without writing Inline XSLT.The reason is that there needs to be flattening (Should not create duplicate <Code> nodes) combined with Cumulative sum.


I found a way using some global variables to resolve this. Even though it might not be the best way, it can help if you do not want to write XSLT inside the mapper. If you are interested, you can download the solution from here

Professional BizTalk Server 2006 Book Update

Phew!  


After some very long days and nights I’ve shipped my second Chapter to Wiley, I decided to go after the chapter I was most passionate about this time round and the Business Activity Monitoring (BAM) chapter was born – some 105 pages which is slightly worrying given the book itself is only supposed to be 700 pages and I’ve got around 14 more chapters to write!   It’s come together really well though, covering all of the BAM plumbing, outlining how you could use it and then demonstrating BAM enabling a proper application and then creating a “Observation Portal” for Dev/Ops and Support people.


My next chapter is on Adapters, after a brief introduction to the guts of Adapters I’m planning to drill into each in-box adapter and cover what it can and cannot do, dynamic properties (when using dynamic ports), context properties they populate and provide some proper real-world examples for each Adapter.


Any suggestions – get them in quick! 🙂


Another big development is that I’ve persuaded my colleague Kevin Smith to contribute to the book which is fantastic news, Kevin as you probably know was a Dev Lead on the BizTalk Product Team up until the 2004 release and was already reviewing the chapters as the official Wiley Reviewer.


Kevin will be writing the low-latency chapter, and contributing to the Testing Chapter (BizUnit) and Performance testing, as the author of BizUnit he’s got the best background for the chapter and we’ve both done large-scale performance testing so it’s great to get his contribution which will make the book even better!


I’ve spoken to a lot of customers recently who seem to be eagerly awaiting the publication which is great to know, I wish it was out today but it’s going to be the end of 2006 I’m afraid 🙁


Thanks for your comments, as ever I’m always keen to hear your feedback – I want 5/5 scores on Amazon! 🙂

Using Test X509 Certificates with BizTalk Web Services

Using Test X509 Certificates with BizTalk Web Services



If you’re planning to use X509 digital certificates to secure communication between services then you would need to test all security features at some point. MakeCert.exe tool can help to generate self-signed certificates for development and integration testing. Here’s the quick process overview. We will need one Certification Authority Root certificate and one ore more (depending on application design and configuration) client and server certificates.



First, create root certification authority certificate. This certificate will be used to sign server and client certificates:



makecert -r -pe -cy authority -n “CN=Test Root Authority  –sk “Test Root Authority -sr CurrentUser -ss My -a sha1 -sky signature TestRootAuthority.cer




This will create self-signed certificate and install it in the CurrentUser/Personal store. Copy this certificate into LocalMachine/ Trusted Root Certification Authorities.


We also need to import this certificate into LocalMachine/Trusted Root Certification Authorities store of all client and server boxes so they can validate certification path. This can be done through MMC Certificates snap-in or using certmgr.exe:



certmgr -add -all -c “TestRootAuthority.cer” -s -r LocalMachine Root




Create server certificate:



makecert -pe -cy end -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.1 -sy 12 –sp “Microsoft RSA SChannel Cryptographic Provider” –n “CN=HostName” -sr CurrentUser -ss My -in “Test Root Authority” -is My -ir CurrentUser TestServer.cer




Using MMC export just created certificate to the pfx file with private key to install it on servers. Note: when installing certificates make sure that account used has access to certificate private key. In case of BizTalk web service this is account for the host instance that runs BizTalk SOAP receive adapter.



Use MMC or certmgr.exe to import server’s public key TestServer.cer into LocalMachine/Other People store on client machines.



Create client certificate:



makecert -pe -cy end -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.2 -sy 12 -sp “Microsoft RSA SChannel Cryptographic Provider” -n “CN=Test Client” -sr LocalMachine -ss My -in “Test Root Authority” -is My -ir CurrentUser TestClient.cer



Install this certificate on the client in the Personal store of the service account that will be sending requests to BizTalk server. Make sure that service account has rights to access certificate private key. If you’re getting HTTP 403 Forbidden error when calling the service that may be the reason behind it. For example, when client makes web service request in context of ASP.NET web application it uses ASP.NET process identity (default, if impersonation disabled is Network Service or ASPNET). To grant certificate access for the specific account use this command:



winhttpcertcfg -g -c LOCAL_MACHINE\My -s “Test Client” -a  Domain\Account



Command above grants access to the “Test Client” certificate private key located in the LocalMachine/Personal to the Network Service account. Command tool winhttpcertcfg.exe is part of Windows SDK and can be found here.



Finally, import client public key into the LocalMachine\Other People store on servers. Then you can enable certificates on the IIS, apply authorization rules, map BizTalk parties to certificates, etc.. This pretty much allows you to reproduce and test real world scenarios with authentication between services, operations authorization, and party resolution in staging environment.

Fully qualified name differs for XSD’s withmultiple root nodes in the Business Rules Engine

One of the most common problems that exist when using the business rules engine is forgetting to use the fully qualified name from a schema in definition of the rule.

Posts like this on Google Groups can clarify what I mean if what I am talking about is not clear.

I have discovered something new regarding the fully qualified name which caught me out this morning and I thought I’d mention it here in case you have the same problem.

If you are using the fully qualified name of a schema with multiple root nodes in the BRE, the fully qualified name must include the name of the root node. When you go to your orchestration and try to feed a rules shape your XSD you will find it won’t recognize it (no drop down appears).

For example you can have a schema with multiple root nodes with a fully qualified name such as schma_name_fully_qualified which, with a single root node, would work just fine. But if the schema has multiple root nodes you must append the specific root node to this qualification for the orchestration to recognize the rule.

So if you had the fully qualified name schma_name_fully_qualified, look at your orchestration view, click on the message you are using and look at the message type: you will find that you must use something like schma_name_fully_qualified.header to properly identify the schema when creating your business rules. Changing this should then allow you to select a message type in your orchestration.

Where in the world am I?

My first tidbit.


 


A recurring issue that pops up with the BAM feature is that of the locale/culture setting. BAM is made up of a number of separate components, SQL, web services, custom tools, and more.  In order for each of the components to operate together effectively, they must all be set to the same locale/culture. In addition, your system and user locale/culture should match those set for BAM.


 


For example, Suppose you are using a Russian deployment of Excel and you create a BAM definition that contains Russian strings for field names and deploy this definition to a BizTalk Server installation that is using US-English.


When the user navigates to the portal and view date/times or sorted lists. The Russian strings will sort with the US-English collation order and dates will be input and displayed using US-English rules.


 


To address this you can change the BAMPortal\Web.config file, by modifying the culture attribute under the <globalization> tag.


 


<globalization requestEncoding=”utf-8″ responseEncoding=”utf-8″ culture=”ru-RU” uiCulture=”en” />


 


Another instance where this can be a problem changing the system or user locale. Say you install Windows Server 2003, English edition and change the system locale to Dutch/Belgium. You then install Microsoft Office 2003 without the MUI packs. When you attempt to deploy a workbook containing  BAM definition you will receive the following error:


C:\myBAM>bm deploy-all -definitionfile:TCM119292-result.xls


Microsoft (R) Business Activity Monitoring Utility Version 3.5.1535.0


Copyright (C) 2006 Microsoft Corporation.  All rights reserved.


 


Using ‘BAMPrimaryImport’ BAM Primary Import database on server ‘KW0083’…


 


ERROR: Failed to open BAM Excel workbook file – ‘C:\ myBAM \TCM119292-result.xls’.


Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))


 


To deploy the workbook, change you locale back to English and redeploy the workbook.

Where in the world am I?

My first tidbit.


 


A recurring issue that pops up with the BAM feature is that of the locale/culture setting. BAM is made up of a number of separate components, SQL, web services, custom tools, and more.  In order for each of the components to operate together effectively, they must all be set to the same locale/culture. In addition, your system and user locale/culture should match those set for BAM.


 


For example, Suppose you are using a Russian deployment of Excel and you create a BAM definition that contains Russian strings for field names and deploy this definition to a BizTalk Server installation that is using US-English.


When the user navigates to the portal and view date/times or sorted lists. The Russian strings will sort with the US-English collation order and dates will be input and displayed using US-English rules.


 


To address this you can change the BAMPortal\Web.config file, by modifying the culture attribute under the <globalization> tag.


 


<globalization requestEncoding=”utf-8″ responseEncoding=”utf-8″ culture=”ru-RU” uiCulture=”en” />


 


Another instance where this can be a problem changing the system or user locale. Say you install Windows Server 2003, English edition and change the system locale to Dutch/Belgium. You then install Microsoft Office 2003 without the MUI packs. When you attempt to deploy a workbook containing  BAM definition you will receive the following error:


C:\myBAM>bm deploy-all -definitionfile:TCM119292-result.xls


Microsoft (R) Business Activity Monitoring Utility Version 3.5.1535.0


Copyright (C) 2006 Microsoft Corporation.  All rights reserved.


 


Using ‘BAMPrimaryImport’ BAM Primary Import database on server ‘KW0083’…


 


ERROR: Failed to open BAM Excel workbook file – ‘C:\ myBAM \TCM119292-result.xls’.


Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))


 


To deploy the workbook, change you locale back to English and redeploy the workbook.

What to expect

Hello!


First let me introduce myself. I am Don Glover, Programming Writer for the Business Activity Monitoring (BAM) feature of BizTalk Server. Many of you will never have heard of a Programming Writer, so here is just a smidgin of back ground information. A Programming Writer is a technical writer who has come over to the writing field from a technical, typically development, back ground. Programming Writers are able to bring a deeper understanding of development issues to a product to better support those products that are used by developers.


This blog will be primarily about subjects relating to the BAM feature, though it may occasionally it may touch on broader BizTalk issues. It will also be a place where, when you have questions about the docs, or complaints, you can contact me, the writer, directly  and I can address them by answering your questions and back filling the information into the documentation.  This will be an opportunity for a two way conversation on the state of the documention. The goal is to provide the best documentaion possible.


I look forward to hearing your feedback as we go forward with this endeavor.