Error parsing WSDL with exception use="encoded"
Asked Answered
T

1

16

Everytime I run wsimport, I get this error:

[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 (error block):

<wsdl:input name="dummyRequest">
        <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                   namespace="urn:cmg.stdapp.webservices.generalplugin" use="encoded" />
</wsdl:input>
Timid answered 1/4, 2014 at 11:9 Comment(0)
N
29

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

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>
Nur answered 20/5, 2014 at 12:1 Comment(1)
I needed a client for an rpc/encoded web service. These instructions "just worked". ThanksAeri

© 2022 - 2024 — McMap. All rights reserved.