WCFStorm

Posted on Saturday 25 April 2009

After some long months involving a lot of talking, meetings and writing documents I have finally started to write code again. What a relief.  It’s an exciting phase for a number of reasons;

1. We are using SCRUM on this project and so far (early days) its working out well

2. We are using WCF to provide the service layer and its turning out to be a nice piece of technology

3. I’m not talking and meeting as much, which is great!

The project involves the development of a set of spatially enabled services. Whilst ArcGIS Server provides the underlying spatial functionality (and services) there is a need to wrap a business logic layer over this functionality. So what I need is a framework to allow me to provide these services, which will provide a core function across many of our clients business processes. Part of the brief is the ability to integrate the services into legacy and new technologies and systems within the organisation. In practical terms not only do we need to provide flexible service interfaces, but also a flexible implementation of those interfaces. Enter WCF.

At the moment we’re mid way through a sprint and one of the items in the sprint backlog is to provide a test harness for our services. Now I’m inherently lazy and don’t want to see the project sink by spending endless hours developing, debugging and generally struggling with a test harness. The .Net Framework provides a WCF test client which is a great start and is the default client when debugging WCF Service projects in VS 2008, however it has some shortcomings. It doesn’t allow you to save and re-executes tests nor does it handle some collection types very well. There are a other testing options out there, however I’m settling on WCF Storm which is proving to be a real asset. 

A few things I really like about WCFStorm:

1. Where a method accepts an abstract type as a parameter WCF handles this really nicely, the type ‘measure’ defined below has four sub classes which are exposed via the service as known types. When a service method takes a ‘measure’ type as a parameter I should be able to pass in any of the four sub types.

 

    [DataContract]
 
    [KnownType(typeof(GeodeticLRM))]
 
    [KnownType(typeof(ReferencePointDistancePast))]
 
    [KnownType(typeof(Literal))]
 
    [KnownType(typeof(StreetAddress))]
 
    public abstract class Measure{
 
   .....
 
    }

In the client we can easily select the actual type to test, and because the sub type carries a [DataMember] attribute the client proxy (WCFStorm) can expose this in its object editor.

wcfstorm12

2.  You can save a request as a test case for reuse together with an expected response:

wcfstorm2

In the above image the input panel shows the request and the expected response and actual response are displayed on the right – you can see that the test has failed – you can view the two responses and identify the values which do not match (would be useful to be able to exclude nodes for the purpose of comparison – i.e. time stamps):

wcfstorm3

3. You can also save a request as a performance test, WCFStorm allows you to configure parameters for the test case and provides a number of reports back:

wcfstorm4

One thing I noticed when running some tests was that WCFStorm summarises the errors that occur during the test however the WCFStorm log does not record these errors. If you enable tracing on your service then you can use the Service Trace Viewer to review the error details. There’s lots of other useful features in WCFStorm, but so far its proving to be an excellent test harness for the project  - well done Erik

1 Comment for 'WCFStorm'

  1.  
    August 12, 2009 | 7:03 pm
     

    [...] answering the inevitable question: How interoperable is my service? Up until now we’ve used WCFStorm as a test harness which has been a really great integration test harness, however it’s [...]

Leave a comment

(required)

(required)


Information for comment users
Line and paragraph breaks are implemented automatically. Your e-mail address is never displayed. Please consider what you're posting.

Use the buttons below to customise your comment.


RSS feed for comments on this post | TrackBack URI