我已经在本地创建了一个 WCF Web 服务,当我访问 wsdl 文件时,如( http://localhost/myservice/service.svc?wsdl它显示 wsdl 文件就好了。然后我将它上传到由 GoDaddy 托管的我的虚拟服务器和当我调用http://my ip address:myport/service.svc?wsdl 时,结果是显示“您已创建服务”的页面。这与我调用相同网址时显示的页面相同,但没有?wsdl ( http://my ip address:myport/service.svc). 如何在虚拟服务器上获取我的 wsdl 文件?为什么这与我的本地机器不同?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.