Dealing with an XSD Choice when XSD.exe doesn’t add XmlChoiceIdentifierAttribute

On my current project we are dealing with some quite complex xsd schemas. Whilst working with one of these I was confused by what I was seeing in the generated code produced by xsd.exe; specifically where an xs:choice was involved. I was expecting to see: An XmlChoiceIdentifier attribute appear on the object in question An…


Windows Identity Foundation 101’s : WS-Federation Passive Requestor Profile (part 1 of 2)

Background It is becoming more commonplace for the means of authenticating a user to be externalized away from the content provider. In federation parlance the content provider is known as the Relying Party (RP) and is so named because it is reliant upon an external entity for authentication, that entity being known as the Identity…


Creating a new Microsoft Word document from a template using OpenXml

When working with Microsoft Word automation there is often the requirement to create documents from define templates. With the addition of the OpenXml specification it is now possible to do this safely within server side code. In a recent project I came across this requirement where a new Word document needed to be created based…


Sending an Email from within Microsoft Word – with the Word document attached

Recently whilst working on a project I had the requirement to send an email from within Word, initiated from the Ribbon command, that contained the Word document as an attachment. Whilst sending an SMTP message was straight forward enough the challenge became accessing the currently active document, as a Stream, without first closing the document…


XML Namespaces and Prefixes

This entry may be useful to people confused by BizTalk’s inclination to insert “ns0” into XML messages, or to anyone confused by XML Namespaces in general. Someone once asked me why their XML document wasn’t validating. They thought that it was because the schema was expecting messages with a default namespace of “uri:my-namespace” but the…


Dynamic XML Reader with C# and .Net 4.0

Along with the new features of .Net 4.0 (including the long awaited Tuple classes, BigInteger, extra Code Access Security stuff, and a brilliant new feature Code Contracts) is the dynamic keyword. This keyword is designed to allow better COM interoperability. Although it probably won’t make an appearance in everyday programming, it will help with interop…