views:

298

answers:

5

I have built a C# .net web service that takes a complex type as a parameter. Is there a testing tool that I can run against my web service and pass all of the values to the complex parameter type?

Some background info: I ran the xsd.exe tool against my XSD and have created a .cs class. This .cs class has the dataset that is used as my complex parameter. Now I need to test out my webmethod and pass values to it as the client would. I have tried WebService Studio and Storm, but it seems that neither of the products can handle complex types. Is there any other product that can do this? Or do I have write my own test application from scratch?

+3  A: 

I would test it by using Visual Studio with a Windows Form referencing your web service. In this Windows Form you can use NUnit, Fit or anything you normally use to test your application. If you run both your Web Service and Windows Form in debug you can walk through the code to see the results.

This is the method I use, I've never really heard of another way within .net Web Services with custom types.

Graham
A: 

Isn't it just as easy to grab a copy of Visual Studio Express (if you don't have the full version) and create a windows application, add a webreference and test it?

Should take you less time, than me reading this question ;) (and no I'm not a slow reader)

Zyphrax
+1  A: 

soapUI will help you do this.

However, the way I usually do it is to write automated unit tests using NUNIT or MSTEST, add a Service Reference and then just write the tests. This has the additional benefit that you are creating the same kind of client code your users will need to do. If your service is hard to use, then you'll find out pretty quick.

John Saunders
+2  A: 

For classic ASMX services, I used Web Service Studio 2.0 which handled every complex type I threw at it. You can get the classic version (2.0) from http://mattharrah.com/blog/web-tools/net-web-service-studio-20/.

I know there is an updated version on codeplex that you linked to and it looks like it's been updated to support complex types. (A while back there was a useless tool on codeplex that couldn't do complex types.)

Just curious what specific issue you are having with Web Service Studio?

UPDATE: After re-reading your question, it sounds like you are using a DataSet in your service. If so, then you are going to have interoperability problems consuming that service from most toolkits; they can't handle the DataSet because it is a "dynamic" type. The easiest way around that issue is to avoid DataSets.

If that is the case, then I agree with others that you will need to create your own .NET application that can consume your service.

Tuzo
Whenever I have the complex type (i.e. dataset) as a parameter value of my webmethod, when WebServiceStudio compiles the Proxy it throws this error, "error CS0260: Missing partial modifier on declaration of type 'ItemList'; another partial declaration of this type exists". If I remove the complex parameter, the error goes away and webservicestudio works correctly.
Jon
A: 

For simple cases you can use WCF Test Client (WcfTestClient.exe) introduced in Visual Studio 2008. Find more on http://msdn.microsoft.com/en-us/library/bb552364.aspx

SoapUI is good for more complex cases.

Andrej Golcov