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

发布于 2024-12-24 20:13:38 字数 2078 浏览 2 评论 0原文

我正在尝试使用 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”处,相对于 '文件:/C:/workspace/ws/wsclient-reactor/shop-wsclient-wsdl/src/main/wsdl/CM_IntegrationService.wsdl':

找不到此文件: 文件:/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 到 Java -client 创建错误 < /一>

<一href="https://stackoverflow.com/questions/4781028/why-is-axistools-maven-plugin-trying-to-access-this-relative-schema-location">为什么 axistools-maven-plugin 尝试访问这个相对架构位置?看起来很相似,但是使用useEmitter=true选项没有帮助。

I'm trying to generate a Java Client with the axis using wsdl2java (wrapped by the maven axistools).

I downloaded the wsdl and the corresponding schema.

The wsdl has the following schema definitions:

<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"/>

In short:

schemaLocation="CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd"

The error shows as:

[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]

In short file not found for:

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

Is there a way to specify which schema to use? I saved the schema as ServiceModel_CM_IntegrationService.xsd. However its searching for the full path including = and ? which I cannot emulate on the file system.

I don't want to modify the wsdl as suggested in: WSDL to Java -client creation error

Why is axistools-maven-plugin trying to access this relative schema location? looks similar however using the useEmitter=true option didn't help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦年海沫深 2024-12-31 20:13:38

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

This is currently not possible without modifying the WSDL. Doing this without modifying the WSDL (BTW, why don't you want to do that?) would require support for XML catalogs, as described in AXIS-1984.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文