Remove Empty Nodes (Stripper)

What if you need to remove all the empty nodes in an XML document? It’ easy with this small subroutine. This might be useful to set fields to NULL when they have no value, especially when communicating between BizTalk and a WCF web service. You might often get serialization errors when, for example, a date/time field has an empty-string value. Better to pass no element to the web service (i.e. NULL) than a field with a bad value.

Action is Incorrect OR Message contains an invalid or expired security context token

Nasty error:
The message could not be processed. This is most likely because the action
‘http://YourService/IYourInterface/YourMethod’
is incorrect or because the message contains an invalid or expired security context token
or because there is a mismatch between bindings. The security context token
would be invalid if the service aborted the channel due to inactivity.
To prevent the service from aborting idle sessions prematurely
increase the Receive timeout on the service endpoint’s binding…

This one can really drive you crazy if you don’t know the secret – click Article Title above to find out…

Connection Closed Unexpectedly

In my specific case, I was calling a WCF service that used LINQ to retrieve data from a database and return as a LIST of LINQ objects. When I ran 85 records, it would run, but when I ran 90 it would not, so I knew the issue was size related.

WCF Tracing

Sometimes, you might need to run a full WCF trace (on both the IIS web service, and the client).
The XML in this article will do that and discuss how to view it.

Business Rules not Firing when using C#

Rules (with static C# routines, such as PolicyChaining, or C# code that adds nodes to the XML), are working fine on XP but not on 2003 (or working on machine and not another). For example, we have a condition of 1=1, which should always fire, but if a static C# routine is found in the actions, then the rules does not fire.

Arrays for XML Objects

How to initialize an array of objects in C#. Often, we write C# test harnesses to populate some test data based on an object structure (which was ultimately created from an xml structure).