Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is wsdl file in WCF service

I have created a WCF web service and locally when I access the wsdl file like (http://localhost/myservice/service.svc?wsdl it shows the wsdl file just fine. I then uploaded it to my virtual server hosted by GoDaddy and when I call http://my ip address:myport/service.svc?wsdl the result is the page where it states "You have created a service". This is the same page that displays when I call the same url but without the ?wsdl (http://my ip address:myport/service.svc). How can I get at my wsdl file on the virtual server? Why did this happen differently than my local machine?

like image 515
user31673 Avatar asked Aug 31 '11 17:08

user31673


People also ask

Where are WSDL files stored?

The files referenced by the <wsdl-file> element in the webservices. xml might import other WSDL or XML Schema Definition (XSD) files. Typically, all WSDL or XSD files are initially placed into the META-INF/wsdl directory when using Enterprise JavaBeans (EJB) or the WEB-INF/wsdl directory when using Java™.

What is WSDL in WCF service?

WSDL stands for Web Service Description Language. The WCF service exposes the WSDL document for the clients, to generate proxies and the configuration file. The WSDL file provides the following information for the consumers of the WCF service.

Does WCF use WSDL?

You can use WCF to export WSDL documents from a ServiceDescription instance for your service. WSDL documents are automatically generated for your service when you publish metadata endpoints.


1 Answers

Make sure that your config file in hosting environment allows retrieving the WSDL document. It should contain this:

<behaviors>
  <serviceBehaviors>
    <behavior name="metadata">
      <serviceMetadata httpGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

And reference this behavior in your service configuration.

Edit:

Just to make it clear. With default WCF behavior, the WSDL file is nowhere. It is auto-generated and this auto-generation must be allowed.

like image 152
Ladislav Mrnka Avatar answered Sep 29 '22 19:09

Ladislav Mrnka