118

I want to get the WSDL file for a webservice and the only thing I have is its URL (like webservice.example/foo).

If I use the URL directly only an error response is delivered.

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
Alfergon
  • 5,463
  • 6
  • 36
  • 56

5 Answers5

165

By postfixing the URL with ?WSDL

If the URL is for example:

http://webservice.example:1234/foo

You use:

http://webservice.example:1234/foo?WSDL

And the wsdl will be delivered.

Alfergon
  • 5,463
  • 6
  • 36
  • 56
  • 3
    All caps sometimes as well (WSDL) – Dan Jul 22 '14 at 13:50
  • And if you don't get the wsdl you may get an xml with a binding key or some sort of validation code that will help you to compose the actual url of the wsdl. – Watchmaker Sep 11 '15 at 08:46
  • 1
    Any idea how to get the imported xsd files? – vikingsteve Jun 21 '16 at 18:32
  • This doesn't work. This is my web service url: https://prealert-test.customer-pages.com –  Oct 26 '16 at 15:42
  • 1
    The ?WSDL thingy is a convention usually followed by frameworks and so. If it's not working for you I guess you should find something specific for the framework you are using. – Alfergon Oct 27 '16 at 07:57
37

to get the WSDL (Web Service Description Language) from a Web Service URL.

Is possible from SOAP Web Services:

http://www.w3schools.com/xml/tempconvert.asmx

to get the WSDL we have only to add ?WSDL , for example:

http://www.w3schools.com/xml/tempconvert.asmx?WSDL

Community
  • 1
  • 1
Jorgesys
  • 124,308
  • 23
  • 334
  • 268
16

Its only possible to get the WSDL if the webservice is configured to deliver it. Therefor you have to specify a serviceBehavior and enable httpGetEnabled:

<serviceBehaviors>
    <behavior name="BindingBehavior">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
</serviceBehaviors>

In case the webservice is only accessible via https you have to enable httpsGetEnabled instead of httpGetEnabled.

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
Manuel Koch
  • 331
  • 2
  • 14
11

To download the wsdl from a url using Developer Command Prompt for Visual Studio, run it in Administrator mode and enter the following command:

 svcutil /t:metadata http://[your-service-url-here]

You can now consume the downloaded wsdl in your project as you see fit.

Talha Imam
  • 1,046
  • 1
  • 20
  • 22
0
  1. explore the url + ?wsdl:

    http://localhost:1234/sevice.aspx?WSDL

  2. right-click on the page and select Save As...

  3. Select XML format and click Save.

Muhammad Zakaria
  • 1,269
  • 6
  • 14