How to generate a WSDL file of a web service in Visual Studio
Asked Answered
T

3

12

I have inventory application in .NET which is going interoperate with Salesforce.

How to generate WSDL file of a web service, I was told that Visual Studio automatically create it and also told that it was not created physically if it is then how to export it to remote machine to access if WSDL.exe command do it with asmx file, what is the exact location where it should be fired.

Please suggest If i am missing any link.

Trimolecular answered 24/4, 2013 at 7:37 Comment(0)
L
34

Nothing special needs to be done to generate the WSDL to your webservice. Just postfix your Webservice url with "?WSDL" and you will get it. For example:

http://localhost/HelloService.asmx?WSDL

Once you do that, save the WSDL as an XML file and add it as web-reference to your client .NET application where you want to call it.

Leede answered 24/4, 2013 at 7:43 Comment(2)
In my case I needed http://localhost:2357/HelloService.asmx. I noticed after wards that right-clicking on the web reference and looking at Properties gave me the Web Reference URLPneumatic
I don't think it's possible to just copy paste from the browser as you'll get those dash marks used for expanding the tree. Use curl with -o option like curl <wsdl-url> -o hello.wsdlMast
U
1

When viewing in a browser, View Source to get rid of the collapsible elements. Then copy/paste that into your favorite XML viewer/formatter if you want something legible.

Uncloak answered 27/3, 2019 at 16:39 Comment(0)
B
0
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\wsdl.exe" /language:CS /namespace:YourNameSpace /out:"G:\Work\YourFileName.cs" http://localhost/Service.asmx?wsdl

This should generate .cs (c#) file.

Broek answered 11/9, 2019 at 9:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.