【问题标题】:Not able to generate web service client using wsgen无法使用 wsgen 生成 Web 服务客户端
【发布时间】:2012-05-10 21:41:16
【问题描述】:

原帖是here

我有一个由 Jax WS 2.1.5 创建并作为 HTTPS 服务公开的第三方 Web 服务 (WSDL :- https://somedomain.com/location/soap/locationfinderservice?wsdl) 我正在尝试使用 wsimport 创建一个客户端。我正在使用 jdk1.6.0_04 以实现兼容性(我切换了我在上一篇文章中解释过的 JDK 版本)现在我收到了新错误

 javax.xml.stream.XMLStreamException: Invalid WSDL expected {http://schemas.xmlsoap.org/wsdl/}definitions found   {https://schemas.xmlsoap.org/wsdl/}definitions at (lineLine number = 1

问题是https://schemas.xmlsoap.org/wsdl/ 不存在。在这种情况下如何生成客户端存根?

【问题讨论】:

    标签: web-services wsdl wsimport


    【解决方案1】:

    你可以通过 http 而不是 https 访问 Wsdl 吗?

    如果没有,请使用浏览器获取 Wsdl 并将其保存在本地,然后稍微修改以更正它。然后将 wsimport 指向调整后的 Wsdl 文件。

    要应用的细微修改:找到文档顶部的命名空间声明(可能类似于xmlns:wsdl="https://schemas.xmlsoap.org/wsdl/")并更改为xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/”(注意http而不是https)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-21
      • 1970-01-01
      • 1970-01-01
      • 2010-09-17
      • 1970-01-01
      相关资源
      最近更新 更多