Is there a testing tool to test a C# .net web service that contains complex types?

14,232

Solution 1

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.

Solution 2

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://archive.msdn.microsoft.com/webservicestudio20/.

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.

Solution 3

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.

Solution 4

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)

Solution 5

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.

Share:
14,232
Jon
Author by

Jon

Software Architect

Updated on June 07, 2022

Comments

  • Jon
    Jon almost 2 years

    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?

  • Jon
    Jon over 14 years
    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.
  • Vincent Vancalbergh
    Vincent Vancalbergh almost 6 years
    I can say that I often need to test these things on a Customer's carefully controlled server where I'm logged into a Citrix Server over a dodgy VPN connection. Installing Visual Studio is not feasable. Copying over a generic tiny portable .Net app is. That's where Web Service Studio comes in handy.