使用异常 use="encoded" 解析 WSDL 时出错 [英] Error parsing WSDL with exception use="encoded"
问题描述
每次运行 wsimport 时,都会出现此错误:
Everytime I run wsimport, I get this error:
[错误]不支持使用 SOAP 编码.file:dummy.wsdl 中第 65 行的 SOAP 扩展元素使用了="encoded" "无法解析 WSDL.
[ERROR] "Use of SOAP Encoding is not supported. SOAP extension element on line 65 in file:dummy.wsdl has use="encoded" " Failed to parse the WSDL.
WSDL(错误块):
<wsdl:input name="dummyRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:cmg.stdapp.webservices.generalplugin" use="encoded" />
</wsdl:input>
推荐答案
这是因为给定的 WSDL 使用的是编码",这是一种 RPC 编码和一种非常古老的做事方式.wsimport 不支持 RPC 编码
This is because the given WSDL is using 'encoded' which is a RPC encoding and a very old way of doing things. RPC encoding is not supported by wsimport
作为替代尝试使用 Apache Axis,它很旧,但我想它会带你去.
As an alternative try use Apache Axis which is yucky and old, but I guess it will get you going.
对于 Maven 项目,将 WSDL 放到 src/main/resources/wsdl并将以下内容添加到您的 pom.xml
For a Maven project, drop your WSDL in src/main/resources/wsdl And add the following to your pom.xml
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis-jaxrpc</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.2</version>
<scope>compile</scope>
</dependency>
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
<configuration>
<packageSpace>com.mycompany.service.client</packageSpace>
<sourceDirectory>src/main/resources/wsdl</sourceDirectory>
<outputDirectory>target/generated-sources/wsdl2java</outputDirectory>
</configuration>
</plugin>
这篇关于使用异常 use="encoded" 解析 WSDL 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!