【问题标题】:WCF metedata download troublesWCF 元数据下载问题
【发布时间】:2014-12-03 00:52:01
【问题描述】:

使用 svcutil 工具为我的应用程序创建 WCF 客户端库时出现以下错误。我可以在本地计算机上成功执行相同的操作,但不能在具有 IIS 的服务器上执行相同的操作。

C:\Program Files (x86)\Microsoft Visual Studio 12.0>svcutil.exe http://beanie.elasticbeanstalk.com/beanie/beanie.svc?wsdl Microsoft (R) 服务模型元数据工具 [Microsoft (R) Windows (R) Communication Foundation,版本 4.0.30319.33440] 版权所有 (c) 微软公司。保留所有权利。

尝试从以下位置下载元数据 'http://beanie.elasticbeanstalk.com/ beanie_deploy/beanie.svc?wsdl' 使用 WS-元数据交换或 DISCO。 Microsoft (R) 服务模型元数据 工具 [Microsoft (R) Windows (R) Communication Foundation,版本 4.0.30319.33440] 版权所有 (c) Microsoft Corporation。保留所有权利。

错误:无法从 http://beanie.elasticbeanstalk.com/beanie_deploy/beanie.svc?wsdl

如果这是您使用的 Windows (R) Communication Foundation 服务 可以访问 ss,请检查您是否启用了元数据发布 在指定的地址。如需帮助启用元数据发布, 请参阅 MSDN 文档 http://go.microsoft.com/fwlink/?LinkId=65455.

WS-元数据交换错误 网址:http://beanie.elasticbeanstalk.com/beanie_deploy/beanie.svc?wsdl

Metadata contains a reference that cannot be resolved: 'http://beanie

.elasticbeanstalk.com/beanie_deploy/beanie.svc?ws dl'。

Content Type application/soap+xml; charset=utf-8 was not supported by servic e

http://beanie.elasticbeanstalk.com/beanie_deploy/beanie.svc?wsdl。客户端和服务绑定可能是 不匹配。

The remote server returned an error: (415) Cannot process the message becaus e the content type 'application/soap+xml;

charset=utf-8' 不是预期的类型 'text/xml; charset=utf-8'..

HTTP GET 错误 网址:http://beanie.elasticbeanstalk.com/beanie_deploy loy/beanie.svc?wsdl

The document was understood, but it could not be processed.

- WSDL 文档包含无法解析的链接。 - 下载“http://win-iu76ruu909k /beanie_deploy/beanie.svc?xsd=xsd0”时出错。 - 无法解析远程名称:'win-iu76ruu909k'

如果您需要更多帮助,请输入“svcutil /?”

我可以做些什么来开始修复它们?

编辑:web.config 文件

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

<services>
  <service behaviorConfiguration="NewBehavior0" name="Syncre_LayerAB_WebService.LayerAB_WebService">
    <endpoint address="" binding="basicHttpBinding"
        bindingConfiguration="" contract="Syncre_LayerAB_WebService.ILayerAB_WebService" />
  </service>
</services>

【问题讨论】:

  • 如果没有来自服务器上 WCF 服务的 节点,很难找出可能出现的问题。
  • 谢谢,我刚刚做了编辑

标签: .net web-services wcf iis svcutil.exe


【解决方案1】:

您的服务已正确配置为发布其元数据,但我怀疑问题出在 IIS 设置上。例如,当您的服务使用匿名访问时,可以将安全性配置为使用 Ntlm 或基本身份验证。

“charset=utf-8' is not the expected type 'text/xml'”错误表明 IIS 返回的是错误消息而不是元数据。尝试在浏览器中打开 svc url (http://beanie.elasticbeanstalk.com/beanie/beanie.svc) 以查看错误消息。

您可能还必须禁用 IIS 的自定义错误功能才能看到真正的错误消息,而不是一般错误消息。

<configuration>
  <system.web>
    <customErrors mode="Off" />
  </system.web>
</configuration>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-03
    • 2012-05-07
    • 2011-04-19
    相关资源
    最近更新 更多