WCF服务中的wsdl文件在哪里
我已经在本地创建了一个 WCF Web 服务,当我访问 wsdl 文件时,例如 (http://localhost/myservice/ service.svc?wsdl 它显示了 wsdl 文件,然后我将其上传到由 GoDaddy 托管的虚拟服务器,当我调用 http://my ip 地址:myport/service.svc?wsdl 结果是显示“您已创建服务”的页面,这与我时显示的页面相同。调用相同的 url,但不带 ?wsdl(http://my ip 地址:myport/service.svc)。在我的 wsdl 文件中为什么这与我的本地计算机不同?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保托管环境中的配置文件允许检索 WSDL 文档。它应该包含以下内容:
并在您的服务配置中引用此行为。
编辑:
只是为了说清楚。使用默认的 WCF 行为,WSDL 文件不存在。它是自动生成的,并且必须允许这种自动生成。
Make sure that your config file in hosting environment allows retrieving the WSDL document. It should contain this:
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.