tags:

views:

4131

answers:

3

I have an old WSDL file and I want to use WCF to communicate with the service.

The WSDL is generated from a ASMX (I suppose but I am not sure).

What would be the required steps to communicate with it ?

Thank you in advance.

+3  A: 

Right-click your project, and choose "Add Service Reference". Point to the WSDL. Click "Ok". That should be all.

John Saunders
+3  A: 

Use svcutil.exe to create a WCF proxy to call the service. Details here.

Anderson Imes
Ok I will give that a go ! There is a file wsdl.exe in visual studio and Windows SDK. I used that to generate a proxy class, is this the same as svcutil.exe ? Once I generate the proxy file, how should I use this generate proxy ?
Raha
Not the same. svcutil.exe is a tool that will generate proxy and stubs (and other things) for WCF. wsdl.exe does similar for ASMX. As of 2006, WCF has replaced ASMX as the preferred web services programming framework in .NET. So, ASMX is old, WCF is new.
Cheeso
+2  A: 

wsdl.exe is the old web service (1.1) way of creating a proxy. The first thing to try is "Add Service Reference" as already mentioned. This uses svcutil.exe to create the proxy. If you need more control over how the proxy is created, you can use svcutil.exe from the command line with a variety of switches.

With that said... I have had trouble with older web service wsdls. In particular, an old Apache AXIS Web Service containing overloaded operations. Please see my post here for complete details. (My problem still isn't solved. I hope you don't encounter the same issues, but if you do and figure them out, please answer my question. :)

Mark Good
There is no concept of "overloading" in web services. Apache should have known better, and hopefully they've learned by now. They also used to do fun things like emit schemas that reference types like apachesoap:XmlElement and then not define these types. Probably worked well if you were using Apache code to consume the service, but not otherwise.
John Saunders
Thanks for the comment, John. Apparently, WSDL 1.1 allowed overloads? (see http://webservices.xml.com/pub/a/ws/2003/01/08/randyray.html) The same service that I mentioned included a bunch of fault types that svcutil couldn't understand. I had a heck of a time getting it to work and only after I made significant edits to the proxy code.
Mark Good