【问题标题】:Error generating proxy with svcutil使用 svcutil 生成代理时出错
【发布时间】:2011-05-25 16:20:26
【问题描述】:

在尝试从此 WebService (http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl) 生成代理时,我从 svcutil 收到此错误:

错误:无法从 http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl

如果这是 Windows (R) 通信 您拥有的基金会服务 访问,请检查您是否拥有 启用元数据发布 指定的地址。寻求帮助 元数据发布,请参考 MSDN 文档位于 http://go.microsoft.com/fwlink/?LinkId=65455.

WS-元数据交换错误 网址:http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl

Metadata contains a reference that cannot be resolved:

'http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl'。

The content type text/xml; charset=utf-8 of the response message

不匹配的内容类型 绑定(应用程序/soap+xml; 字符集=utf-8)。如果使用自定义 编码器,请确保 IsContentTypeSupported 方法是 正确实施。第一个 553 响应的字节数是:'
ns1:Client.NoSOAPAction 没有 SOAPAction 头! usalwsc01 '。

The remote server returned an error: (500) Internal Server Error.

HTTP GET 错误 网址:http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl

The document at the url http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl

未被识别为已知文档 类型。每个人的错误信息 已知类型可以帮助您修复 问题: - 来自“XML Schema”的报告是“W3C XML Schema 的根元素” 应该是和它的命名空间 应该 'http://www.w3.org/2001/XMLSchema'。'。 - 来自“DISCO 文档”的报告是“URL 上的发现文档” http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl 找不到。 - 无法识别文档格式。 - 来自“WSDL 文档”的报告是“XML 文档中存在错误” (242, 18)。'。

  • 命名空间前缀“impl:wb”未定义。

我使用这些参数调用了 svcutil:

svcutil /n: *,WB.Client /et:WB.Client.WSResultObject /o:客户端\WBServices /noConfig http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl

有人知道我可以做些什么来生成代理吗?我无法更改服务器端的服务。

【问题讨论】:

    标签: wcf svcutil.exe webservices-client


    【解决方案1】:

    问题是服务使用的绑定命名约定与 svcutil 不兼容。您可以按以下方式解决此问题:

    • 浏览服务的 WSDL URL 和 将 WSDL 保存到本地文件。
    • 然后对文件进行以下更改:
    • 从用于 wsdl:binding 的名称中删除命名空间前缀,即更改

      name="wb:wsclocks-inboundSoapBinding"

      name="wsclocks-inboundSoapBinding"

    • 将wsdl:port属性的binding属性改成匹配,同时去掉name属性值的命名空间前缀,所以就是wsclocks-inbound了。 p>

    然后运行svcutil <wsdl-file-path> /o:Client\WBServices /noConfig

    【讨论】:

      猜你喜欢
      • 2014-04-15
      • 1970-01-01
      • 2011-10-20
      • 2012-11-26
      • 2011-06-03
      • 2012-02-05
      • 2011-08-23
      • 1970-01-01
      相关资源
      最近更新 更多