Where is the wsdl file in the WCF service

I created a WCF web service and locally when I access the wsdl file ( http: //localhost/myservice/service.svc? Wsdl , it shows that the wsdl file is just fine. Then I uploaded it to my virtual server hosted by GoDaddy , and when I call http: // my ip address: myport / service.svc? Wsdl, the result is on the page that says β€œYou created the service.” This is the same page that displays when I call the same url, but without? wsdl ( http: // my ip address: myport / service.svc). How can I get in my wsdl file on a virtual server? Why did this happen differently than my local machine?

+7
source share
1 answer

Make sure that your configuration file in the hosting environment allows you to get a WSDL document. It should contain the following:

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

And specify this behavior in the configuration of your service.

Edit:

Just to be clear. With the default WCF behavior, the WSDL file is nowhere. It is generated automatically and this auto-generation should be enabled.

+12
source

All Articles