【问题标题】:Unable to create service reference for wsdl file无法为 wsdl 文件创建服务引用
【发布时间】:2015-05-03 21:50:14
【问题描述】:

我的本​​地机器上有wsdl 文件和xsd 文件。我想在项目中添加服务引用。我没有网络服务我只有wsdl 文件。

我收到以下错误:

The document was understood, but it could not be processed.
  - The WSDL document contains links that could not be resolved.
  - There was an error downloading 'http://localhost/DService/AllService.svc?xsd=xsd0'.
  - The request failed with HTTP status 404: Not Found. 

【问题讨论】:

  • 编辑 WSDL 以链接到磁盘上同一目录中的 XSD 文件,而不是通过 HTTP URL。
  • XSD 模式位置在 wsdl 中是这样的localhost/DService/AllService.svc?xsd=xsd0" namespace="tempuri.org/">
  • 是的,所以删除 http://localhost... 部分。
  • 喜欢这个 schemaLocation="/DService/AllService.svc?xsd=xsd0" 或
  • 不,比如schemaLocation="XsdFile0.xsd"

标签: c# asp.net web-services xsd wsdl


【解决方案1】:

您的设置已完成,包含一个 wsdl 文件和几个 xsd 文件。 您遇到该问题的原因是链接 'http://localhost/DService/AllService.svc?xsd=xsd0'. 已损坏。

解决方案是在包含 xsd 文件的文件夹中搜索 AllService 。 为方便起见,请将所有文件放在一个文件夹中。接下来是复制包含搜索短语AllService 的文件的绝对路径,将localhost url 替换为文件的绝对路径。

再次运行命令并观察它的工作情况。

注意:请勿删除 url,因为这对于制作完整的代理至关重要。

【讨论】:

    猜你喜欢
    • 2021-01-19
    • 2010-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多