.net web service: Can’t add service reference, only web reference

netweb services

I have an existing project that consumes web services. One was added as a service reference, and the other as a web reference. I don't recall why one was added as a web reference, but perhaps it's because I couldn't get it to work!

The existing service reference for the one web service works fine, so it's not a .net version issue.

I can successfully create a service reference for the second web service, but none of the methods are available. The .wsdl shows the schema, but the Reference.vb shows only the Namespace, and none of the methods.

To clarify, these are two different 3rd party web service providers.

We'd like to move to the service reference so we have more control over the configuration as we're having various issues with timeouts.

Anyone come across this before?

Edit

Does it matter that there are two services at the address?

Edit

I'm using .net 3.5 and VS2008.

alt text http://img139.imageshack.us/img139/719/addservicereference.gif

Best Answer

The Add Service Reference feature is notoriously a pig and is buggy - I use it most of the time, but occasionally I hit problems where the code it generates is either like this (i.e. non-existent) or it doesn't reuse types where it should do.

You should try using the svcutil command line tool (open a VS Command Prompt to run it), which although it is similar to the reference feature of VS is actually a completely different codebase. You can use that to generate a proxy, all the client-side types etc, just as with the service reference feature.

Most importantly - it seems to work nearly all the time - so long as the service itself is sane.