WCF Windsor Interceptor, AOP with Logging and Exception Handler Interceptor

The above example uses Windows Communication Foundation (WCF) Integration Facility The main idea here is that WCF should get the service instances from Windsor, which gives us all the usual advantages of IoC plus Windsor’s interceptors capabilities. It isn’t a lot of code, but it makes it much easier to work with WCF services. The service contains 2 simple methods on the HelloWorld class. SayHello – returns a string “Hello World” ThrowException – throws an exception Every single call to each of these is intercepted and logged. Whilst the throw exception will always be caught by the exceptionhandler interceptor. ...

February 2009 · Smart Tech

Performance Testing using a counting semaphore -- Dijkstra

Running some performance tests using Fitnesse to test the limits of a new Sharepoint DMS solution produced this solution. The code we are trying to test is the AddDocument and the time it takes each call to this to succeed. So we need to add n number of documents to Sharepoint using x number of threads through a WCF service_,_ where n and x are configurable via the Fitnesse wiki ...

January 2009 · Smart Tech

Winforms export datatable to excel without COM+

Simple export of a datatable to excel without using COM+ Excel will ask if you want to open this as ‘An XML List’ SaveFileDialog fileDialog = new SaveFileDialog(); fileDialog.Filter = "Excel files (\*.xls)|\*.xls"; fileDialog.FileName = "My\_File\_Name.xls"; fileDialog.ShowDialog(); DataTable dt = GetFilteredDataTable(); using (FileStream fs = (FileStream)fileDialog.OpenFile()) using (StreamWriter sw = new StreamWriter(fs)) { sw.Write("<?xml version=\\"1.0\\" standalone=\\"yes\\"?>"); dt.WriteXml(sw, XmlWriteMode.IgnoreSchema); sw.Close(); fs.Close(); }

July 2008 · Smart Tech