Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

wsdl

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.

like image 409
Alfergon Avatar asked Dec 23 '13 11:12

Alfergon


People also ask

What is WSDL endpoint URL?

The actual endpoint URL that is contained in a published WSDL file consists of the prefix followed by the module's context-root and the web service url-pattern, for example, http:// myHost :9045/services/ myService .


4 Answers

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.

like image 60
Alfergon Avatar answered Oct 22 '22 05:10

Alfergon


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

like image 23
Jorgesys Avatar answered Oct 22 '22 05:10

Jorgesys


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.

like image 10
Talha Imam Avatar answered Oct 22 '22 04:10

Talha Imam


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.

like image 16
Manuel Koch Avatar answered Oct 22 '22 05:10

Manuel Koch