9

I need to consume a WCF service based on a (preferably single) wsdl file.

The environment is VS-2008 (sp1), and I will be using a customized "Add Service Reference" macro to generate an error handling proxy. I want to be able to do this, by supplying a WSDL file that I get from the service provider (I do not want to supply a host URL).

How can this be done?

p.campbell
  • 98,673
  • 67
  • 256
  • 322
Assaf Stone
  • 6,309
  • 1
  • 34
  • 43

1 Answers1

19

Sure - you can copy the path+filename for the WSDL and paste that into the "Add Service Reference" dialog box in Visual Studio (or just type int the full path + WSDL file name).

enter image description here

Alternatively, you can use the svcutil.exe command line utility to convert the WSDL file to your client proxy class.

p.campbell
  • 98,673
  • 67
  • 256
  • 322
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • I tried adding a service reference from a local wsdl, one that has multiple contracts, and all I got was a blank reference.cs file (it had the code-gen remarks, but that's it). Any idea why? Thanks, Assaf. – Assaf Stone Oct 01 '09 at 13:09
  • that would indicate an invalid WSDL, probably - or it can't handle the multiple services inside the same WSDL - not 100% sure – marc_s Oct 01 '09 at 13:18
  • Geez! Why can't Microsoft add an open file dialog? At the very least lanel the field "Address or file path:" – ATL_DEV Oct 24 '17 at 19:42
  • @ATL_DEV, Microsoft have added the open-file dialog to .Net core. – Olorunfemi Davis Dec 06 '18 at 11:30