12

I have WSDL files that I need to add to my project as web references. They are located with .wsdl extensions in my local directory. I have never added them like this so I am not really sure how I can add them as a web reference.

I haven't been able to find something useful. Any ideas?

Tarik
  • 79,711
  • 83
  • 236
  • 349

4 Answers4

22
  1. Right click on project and select add Web Reference

  2. In dialog Box type on the URL File://test.xsdl

Tarik
  • 79,711
  • 83
  • 236
  • 349
Aghilas Yakoub
  • 28,516
  • 5
  • 46
  • 51
  • 2
    I didn't think that and it works so good. Thanks for your answer. But I will accept your answer after 6 minutes as SO doesn't allow me beforehand. – Tarik Jul 26 '12 at 17:05
  • 1
    Hint: open the file in a browser and snag the url. On Windows the path looks like `file:///C:/path/file.xml` – JackMorrissey Sep 26 '19 at 14:54
3

No answer was accurate for me, but for VS2019, to add a wsdl file as a service reference, I right-clicked on the project -> add -> connected services -> Microsoft WCF Web Services reference -> browse the .wsdl file. This will generate the code to call the referenced services.

Dan Atkinson
  • 11,391
  • 14
  • 81
  • 114
Cromm
  • 328
  • 6
  • 25
2

Right click on the project, click on 'Add Service Reference'. Add the path to the WSDL file. It will generate the code to call the service for you.

Paolo del Mundo
  • 2,121
  • 13
  • 18
0

To add a wsdl file as a service reference, right-click on the project > Add > Connected Services > Microsoft WCF Web Services reference.

Select the .wsdl file you want and then the code for calling the service will be generated for you if the there are no mistakes in the wsdl.

This can also be helpful: How to use a WSDL

Dan Atkinson
  • 11,391
  • 14
  • 81
  • 114