WCF托管:可以访问svc文件但不能转到wsdl链接 [英] WCF hosting: Can access svc file but cannot go to wsdl link

查看:25
本文介绍了WCF托管:可以访问svc文件但不能转到wsdl链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个托管在 IIS 7.5 中的 WCF 服务.我有两台服务器,一台用于测试,一台用于生产.

I have a WCF service that is hosted in IIS 7.5. I have two servers, one for test and one for production.

该服务在测试服务器上运行良好,但在生产服务器上出现以下错误.

The service works fine on test server, but on the production server I have the following error.

当我访问地址 http://..../service.svc 时,我可以看到默认页面:

When I access the address http://..../service.svc I can see the default page that says:

您已经创建了一个服务.

You have created a service.

要测试此服务,您需要创建一个客户端并使用它来调用该服务.您可以使用以下语法从命令行使用 svcutil.exe 工具执行此操作:

To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:

svcutil.exe http://..../service.svc?wsdl

这将生成一个配置文件和一个包含客户端类的代码文件.将这两个文件添加到您的客户端应用程序并使用生成的客户端类来调用服务.

This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service.

但是当我点击 wsdl 链接时,我无法进入 wsdl 页面.它使我返回到这个默认网页,没有任何错误.我怀疑是网络/防火墙授权错误,但有人有这样的经历吗?

But when I click the wsdl link, I cannot go to the wsdl page. It returns me to this default web page without any errors. I am suspecting a network/firewall authorization error but does anybody have an experience like this one?

测试和生产服务器的所有 IIS 设置都相同.

All IIS settings are the same for test and production servers.

谢谢,最好的问候.

推荐答案

遇到了同样的问题.我通过将 httpsGetEnabled 添加到 serviceBehaviors> 像这样的行为来修复它:

had the same problem. i fixed it by adding httpsGetEnabled to serviceBehaviors>behavior like this:

<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>

也许它可以帮助其他人.不要认为 4 年后你需要这个提示 =)

maybe it helps someone else. dont think that u need this hint after 4years =)

这篇关于WCF托管:可以访问svc文件但不能转到wsdl链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆