【发布时间】: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 选项没有帮助。
【问题讨论】: