我正在尝试使用wsdl2java
生成一个带有轴的Java客户端(由maven axistools包装)。
我下载了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',相对于 '文件:/ 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 - &gt; [帮助1]
找不到简短的文件:
/C:/workspace/ws/wsclient-reactor/wsclient-wsdl/src/main/wsdl/CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd
有没有办法指定使用哪个架构?我将架构保存为ServiceModel_CM_IntegrationService.xsd
。然而,它搜索包含=
和?
的完整路径,我无法在文件系统上模拟。
我不想按照WSDL to Java -client creation error
中的建议修改wsdl Why is axistools-maven-plugin trying to access this relative schema location?看起来很相似但是使用useEmitter=true
选项没有帮助。