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?
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™.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With