Alfergon
Alfergon

Reputation: 5919

How to get the wsdl file from a webservice's URL

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.

Upvotes: 134

Views: 515331

Answers (6)

Khoward
Khoward

Reputation: 351

I tried many of the recommended answers (including the accepted one) and was getting a "Request Format is unrecognized" error when going to the ?wsdl url. What I found was that there was the following block in the parent folder of the webservice's web.config:

<webServices>
  <protocols>
    <remove name="Documentation" />
  </protocols>
</webServices>

That was removing the ability to access the WSDL information. Removing that "remove" tag and then following the accepted answer got it working.

Upvotes: 0

zakk616
zakk616

Reputation: 1542

  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.

Upvotes: 0

Talha Imam
Talha Imam

Reputation: 1106

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.

Upvotes: 13

Manuel Koch
Manuel Koch

Reputation: 361

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.

Upvotes: 19

Jorgesys
Jorgesys

Reputation: 126455

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

Upvotes: 39

Alfergon
Alfergon

Reputation: 5919

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.

Upvotes: 183

Related Questions