views:

73

answers:

2

Hi

Is there a way to test, from my code on a client machine, whether my WebService is up and running, without having to invoke a WebMethod on the service ?

+4  A: 

Do you include "fetching the WSDL" as "invoking a WebMethod"? That would be a fairly simple way of checking without touching anything within the web service code itself... but if you want an even more hands-off approach than that, you need to work out what you're actually trying to test. For instance, you could connect to port 80 (or whichever port your web server is running on) but that wouldn't tell you much.

The more invasive you are, the more confident you can be that the web service is actually running. For example, fetching the WSDL as I suggested earlier doesn't mean that the web service will manage to respond to requests properly: it might be trying to use an invalid database connection string, for example.

You might want to include a "Test" web method which can be used for some basic diagnostics. Think about the security aspect though, which will partly depend on how the web service is being deployed. (Is it for a LAN or a WAN, for example?)

Jon Skeet
A: 

If you don't mind using Java, you can install soapUI. This tool can run tests against any web service and validate its behaviour.