We help IT Professionals succeed at work.

Import WSDL into C#

rjef
rjef asked
on
I am trying to understand how to import a WSDL file into C#.  I need step by step instructions.  Or if that is even the process.
Comment
Watch Question

Most Valuable Expert 2011
Top Expert 2015
Commented:
1) Open Visual Studio Command Prompt
2) Execute
            wsdl.exe /o:"path/to/output/file.name" [path or URL to xsd] [path or URL to xsd] ...
Gorkem YukselDirector, IT Development

Commented:
If you are trying to get a webservice reference, you can easily import the wsdl by going into Visual Studio and in your solution explorer, you will see a folder called References.  Right click on this folder and select Web Reference.  

You will be prompted for a URL, which is where you will type in the web address of the webservice you are trying to comsume.  The rest just falls into place.

Cheers,

G.

Author

Commented:

'wsdl.exe' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>

Author

Commented:
pballan: i am using the visual studio 2008 express.  Actually i only have the C# modual.  In you link they say to
1. Open the Solution Explorer in my project.
how do I do that.

Author

Commented:
gyuksel:
 i do not have a url all i have is a WSDL file.
Gorkem YukselDirector, IT Development

Commented:
Hi,

Have you tried creating the following folder in your project director and adding the wsdl file directly into it?

....\App_WebReferences\ServiceName\Service.wsdl

gyuksel:
 i do not have a url all i have is a WSDL file.
-> You can setup a local http server like IIS or wamp server and hosting file wsld in local