gpt4 book ai didi

java - axis2 无法使用内联模式从 wsdl 生成 java

转载 作者:行者123 更新时间:2023-11-29 05:43:44 25 4
gpt4 key购买 nike

我想从 WSDL 生成 Java 类。我正在从 ant 任务中调用 wsdl2java。命令行看起来像这样:

java -cp ... org.apache.axis2.wsdl.WSDL2Java -o generated_dir -S . -R . -l java -p "com.make.me.rich" -d adb -or --noBuildXML -uri MakeMeRich.wsdl

MakeMeRich.wsdl 包含来自 Micrsosoft 的内联模式,例如:

<xsd:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<xsd:complexType name="ArrayOfint">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="int" type="xsd:int" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ArrayOfint" nillable="true" type="tns:ArrayOfint" />
<xsd:complexType name="ArrayOfKeyValueOfstringstring">
<xsd:annotation>
<xsd:appinfo>
<IsDictionary xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</IsDictionary>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="KeyValueOfstringstring">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Key" nillable="true" type="xsd:string" />
<xsd:element name="Value" nillable="true" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ArrayOfKeyValueOfstringstring" nillable="true" type="tns:ArrayOfKeyValueOfstringstring" />
</xsd:schema>

但是 wsdl2java 解析器给出警告:

[java] Warning: No schemaLocation for import of http://schemas.microsoft.com/2003/10/Serialization/Arrays; compilation may fail

关于如何使用 wsdl2java 处理内联模式有什么想法吗?

最佳答案

使用数据绑定(bind) xmlbeans 似乎可以解决问题:-d xmlbeans

关于java - axis2 无法使用内联模式从 wsdl 生成 java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16568551/

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