Simple C# XML Schema Validation

While working I’ve often had to deal with data being sent in XML. Specifically, working on web services which are constantly passing it around. This data usually needs to be marshaled into some domain objects to continue working, but sometimes the data being sent is no good. One solution I found to fail early when encountering bad XML was validating it against it’s schema. I’m not sure if there are simpler ways, but this is how I was able to do it in C#: public string IsValidXml(string xmlString, string schemaPath) { if (string.IsNullOrWhiteSpace(xmlString)) { throw new ArgumentNullException(“xmlString”); } if (string.IsNullOrWhiteSpace(schemaPath)) { Continue reading Simple C# XML Schema Validation

MongoDB Replica Set Windows Service

I have been doing some development using MongoDB lately, and I have been very happy with it. One of the things I had to do was set it up as a Windows service in the development servers where I work. The process was relatively simple, but seems like a great bit of information to document. I will be showing the settings I use, which include creating the mongo instances as part of a replica set and exposing a RESTful service for monitoring. The following can be done from either the standard Windows command line or PowerShell. I assume you are somewhat familiar with Continue reading MongoDB Replica Set Windows Service

WordPress: 1and1 Click & Destroy

When I first started this endeavor I was swayed by the simplicity of 1and1’s (my host) touted ‘Click & Build’ feature. I was so swayed by it that I made the mistake of first attempting to set up WordPress like that. What I got was a husk of WordPress, an outdated, impossible to update or fully customize version. After removing this version with 1and1’s much more useful feature, the one click uninstall, I set about to set up WordPress on my own. As it turns out this is not a difficult task at all. The following guide should show anyone Continue reading WordPress: 1and1 Click & Destroy