【问题标题】:axis wsdl2java fails reading schema with special characters轴 wsdl2java 无法读取带有特殊字符的模式
【发布时间】:2012-01-04 16:19:10
【问题描述】:

我正在尝试使用 wsdl2java(由 maven axistools 包装)生成带有轴的 Java 客户端。

我下载了 wsdl 和相应的架构。

wsdl 具有以下架构定义:

<wsdl:types>
<xsd:schema 
  targetNamespace="http://example.com/CM_IntegrationService/"
  xmlns:pref="http://example.com/CM_IntegrationService" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:import namespace="http://example.com//CM_IntegrationService"
      schemaLocation="CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd"/>

简而言之:

schemaLocation="CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd"

错误显示为:

[错误] 无法执行目标 org.codehaus.mojo:axistools-maven-plugin:1.4:wsdl2java (默认)在项目 wsclient-cm 上:从 WSDL 生成 Java 代码时出错。错误运行 文件:/C:/workspace/ws/wsclient-reactor/wsclient-wsdl/src/main/wsdl/CM_IntegrationService.wsdl:

WSDLException(在 /wsdl:definitions/wsdl:types/xsd:schema):faultCode=OTHER_ERROR: 尝试解析引用的架构时发生错误 在 'CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd',相对于 'file:/C:/workspace/ws/wsclient-reactor/shop-wsclient-wsdl/src/main/wsdl/CM_IntegrationService.wsdl'.:

未找到此文件: file:/C:/workspace/ws/wsclient-reactor/wsclient-wsdl/src/main/wsdl/CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd -> [帮助1]

简而言之,找不到以下文件:

/C:/workspace/ws/wsclient-reactor/wsclient-wsdl/src/main/wsdl/CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd

有没有办法指定要使用的架构?我将架构保存为ServiceModel_CM_IntegrationService.xsd。但是它正在搜索完整路径,包括我无法在文件系统上模拟的 =?

我不想按照以下建议修改 wsdl:WSDL to Java -client creation error

Why is axistools-maven-plugin trying to access this relative schema location? 看起来很相似,但是使用 useEmitter=true 选项没有帮助。

【问题讨论】:

    标签: java wsdl2java axis


    【解决方案1】:

    如果不修改 WSDL,目前这是不可能的。在不修改 WSDL 的情况下执行此操作(顺便说一句,您为什么不想这样做?)将需要支持 XML 目录,如 AXIS-1984 中所述。

    【讨论】:

    • 思路是直接下载文件,用maven启动服务生成。应将手动交互保持在最低限度,以免其成为错误源。可以避免的步骤不会产生错误。感谢您的链接。
    • 那你为什么不直接将 HTTP URL 提供给 wsdl2java?
    • 也考虑到这一点。然而,带有网络服务的服务器并非一直都在运行,而且它并不总是携带最新版本。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多