Error parsing WSDL with exception use=“encoded”

让人想犯罪 __ 提交于 2019-12-03 11:11:24
rjdkolb

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

Some more info on your error message (original, broken link on java.net)

As an alternative try use Apache Axis which is yucky and old, but I guess it will get you going.

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!