Java: Rpc / encoded wsdls are not supported in JAXWS 2.0

I use CXF 2.1 to generate java code from wsdl, but I get the following error:

WSDLToJava Error: Rpc/encoded wsdls are not supported in JAXWS 2.0 org.apache.cxf.tools.common.ToolException: Rpc/encoded wsdls are not supported in JAXWS 2.0 at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.checkSupported(JAXWSDefinitionBuilder.java:141) at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:87) at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:61) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:127) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232) at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83) at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103) at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173) 

How to fix this error, can I use the previous version of CXF or anything else to fix it?

+49
java jax-ws
Jan 05 '09 at 10:45
source share
5 answers

RPC / encoded is the remainder before SOAP objects were defined using an XML schema. This is no longer supported . You will need to generate stubs using Apache Axis 1.0 , which dates back to the same era.

 java org.apache.axis.wsdl.WSDL2Java http://someurl?WSDL 

In the -cp classpath parameter, you will need the following banks or equivalents:

  • Axis 1.4.jar
  • General Logging 1.1.ja
  • Public Discovery-0.2.jar
  • JAXRPC-1.1.jar
  • SAAJ-1.1.jar
  • wsdl4j-1.4.jar
  • activation-1.1.jar
  • mail 1.4.jar

This will create similar stubs for wsimport.

Alternatively, if you are not using parts of the circuit that require rpc / encoded, you can download a copy of WSDL and comment on these bits. Then run wsimport against the local file.

If you look at WSDL, the following bits use rpc / encoded:

 <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
+66
Jan 06 '09 at 3:14
source share

I used Axis 1.4 as Chase Seibert in his answer , although the download link provided in this answer does not work. The alternative download link I used gave me different libraries. Below are the steps that I followed to generate my code.

Go to http://apache.is.co.za/axis/axis/java/1.4/ and download axis-bin-1_4.zip .

Extract it and you should have the following files (among others):

  • axis.jar
  • Public Discovery-0.2.jar
  • General Logging 1.0.4.jar
  • jaxrpc.jar
  • saaj.jar
  • wsdl4j-1.5.1.jar

Run WSDL2Java using the following command (replacing the url of course):

 java -cp axis.jar;commons-logging-1.0.4.jar;commons-discovery-0.2.jar;jaxrpc.jar;saaj.jar;wsdl4j-1.5.1.jar org.apache.axis.wsdl.WSDL2Java http://someURL?WSDL 

This will create your java files.

PS: This seems to work equally well with Axis 1.2.1.

+11
Jul 28 '14 at 6:43
source share

Perhaps this will help with CXF. Alteast it worked for me. I edited the WSDL file and deleted all the SOAP-ENC links and created the ArrayOfString type below

 <xsd:complexType name="ArrayOfString"> <xsd:sequence> <xsd:element minOccurs="0" maxOccurs="unbounded" name="String" type="xsd:string"/> </xsd:sequence> </xsd:complexType> 
+5
Apr 17 '12 at 17:10
source share

Chase Serbeit answer worked for me. And here are the links that I found in the whole library that he mentioned:

0
Apr 27 '16 at 7:04 on
source share

just extract and execute WSDL2Java? using the following command (replacing the url of course):

 java -cp axis.jar;commons-logging-1.0.4.jar;commons-discovery-0.2.jar;jaxrpc.jar;saaj.jar;wsdl4j-1.5.1.jar org.apache.axis.wsdl.WSDL2Java http://someURL?WSDL 
-one
Aug 4 '16 at 8:09
source share



All Articles