javaweb-servicessoapuiwadl

Wadl2Java SoapUI Error in Generation


I'm trying to generate Java from Wadl in SoapUI (I used wsImport for WSDL with success). My problem is that

1) I am not sure what to fulfill in the fields

2) I m having an error.

I set the output directory a directory that I want and in tools at the field WADL2Java I browse the directory of apache-cxf-3.2.2-src (I download it from apache).

Then I run generate and I get that error:

wadl2java com.eviware.soapui.impl.support.definition.support.invaliddefinitionexception

I am not sure if I fulfill the fields correctly (e.g I didn't fulfill package field) but things are not so clear like WSDL and wsimport!

Thanks in advance!


Solution

  • It looks like you've downloaded the source version of CXF when you really need the binary version apache-cxf-3.2.2.zip. The bin directory contains the wadl2java file you need.

    I've always found that generating WADL (or WSDL artifacts) through soapUI a little too hard: it accepts only the minimum arguments (output directory, package name) and for anything else you have to specify command options. So, I prefer to use the generators directly from the command line. There's a good description of how to do this at WADL First Development.

    There's lots of options, but just start with the minimum (output directory, package name, WADL location), generate some files, and add more options and retry until you get the output you need.

    For example, the following command on a Mac generates and compiles classes off a WADL in ~/Downloads/sample-wadl.xml, puts the output in ~/soapui-gen, and uses a package name of com.example :

    ./wadl2java -p com.example -d ~/soapui-gen -compile ~/Downloads/sample-wadl.xml