March 2005 - Posts

Following a course about RUP OO design an analysis (March 2004) the mentor told us that you should have running skills when designing systems … just in case things getting really bad … run, Forrest, run … So I started training, training and training. Runned the ‘dam tot dam loop’ and the ‘city pier city loop’ but ended up at position 6963 and 1339. Probably not fast enough to beat the project manager or clients. I will continue running … I will go faster ...  maybe some day I can beat them all (including my wife J). 

 

When you’re creating an application which only contains webservices you’re demo to the client can be little bit disappointing. A lot of XML tags, SOAP headers and WSDL scripts, not a very slicky interface. As long as you’re using simple types in you’re interface the Internet explorer can be used to demonstrate the web service, but when you’re using complex types (as arguments!) the internet explorer only shows the interface specifications and can’t run you’re webservice anymore. 

So you can build an ASP.NET or Winform application to demonstrate the working of the webservice. Create a form, drag and drop a bunch of controls to fill the interface and call the webservice and fill the controls on the form with the information from the webservice. 

You can do this easier since the release of SP1 from InfoPath 2003. InfoPath 2003 can communicate with webservices and can handle complex types. When you create a new InfoPath form you can connect to different datasources, a webservice is one of them. 

I created an example of a webservice which accepts an array (min/max prices of products) and return an array of found products (name, stock, price and startdate). After InfoPath has connected to the webservice it interprets the WSDL file and creates (figure 1) the possibility to drag and drop the arguments en output fields on the form. With the button you can call the webservice and the results are shown on the form (figure 2). 

So after a few clicks you can test (if you don’t like Nunit) or demonstrate the webservice you’ve build with InfoPath 2003.

 

 Figure 1

 Figure 2

 

 

 

A little challenge for you, what wrong with the title … ready … absolutely nothing. There are currently two open source products which ‘cover’ the same functionality and obviously have the same name … Ncover.

I wanted to use a code coverage tool integrated in the daily build process. The build process was created with the use of Nant, Nunit and CruiseControl.Net. Both versions of Ncover can be used with these tools.

The first Ncover tool has been moved from GotDotNet to www.ncover.org (latest release dec 2004). This version has no integration with Nant, but has a command line interface which can be used along with the Exec task from Nant to implement a code coverage in the daily build. 

The second Ncover tool you can download at sourceforce (latest release jun 2004) This version integrates with Nant by using its own tasks. You’ll need 4 tasks to get the coverage of you’re tests. The creepy thing about this tool is that the ncover task has to ‘instrument’ you’re code to create some helpers for the coverage process.

Based on the ‘instrument’ issue I started with the first (www.ncover.org) Ncover tool. For each Nunit project within our solution I have created an Exec task to get a coverage of the code. Example: 

         commandline='/c "nunit-console.exe" "Project.nunit /xml=nunit-results.xml

            /out=nunit-results.output /nologo"

            /a AssemblyA;AssemblyB /o ncover-results.xml /l ncover.log'/> 

You can parse the results with the standard coverage.xsl or with this alternative and it give’s you the coverage of the nunit tests within you’re solution. And of course we all have the following results:  

 

 

See also a great tutorial for Ncover starters.