gpt4 book ai didi

java - axis wsdl2java 无法读取带有特殊字符的模式

转载 作者:太空宇宙 更新时间:2023-11-04 08:25:04 24 4
gpt4 key购买 nike

我正在尝试使用 wsdl2java (由 maven axistools 包装)生成带有 Axis 的 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"

错误显示为:

[ERROR] Failed to execute goal org.codehaus.mojo:axistools-maven-plugin:1.4:wsdl2java (default) on project wsclient-cm: Error generating Java code from WSDL. error running file:/C:/workspace/ws/wsclient-reactor/wsclient-wsdl/src/main/wsdl/CM_IntegrationService.wsdl:

WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd', relative to 'file:/C:/workspace/ws/wsclient-reactor/shop-wsclient-wsdl/src/main/wsdl/CM_IntegrationService.wsdl'.:

This file was not found: file:/C:/workspace/ws/wsclient-reactor/wsclient-wsdl/src/main/wsdl/CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd -> [Help 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 选项没有帮助。

最佳答案

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

关于java - axis wsdl2java 无法读取带有特殊字符的模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8730112/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com