javarestweb-serviceswadl

wadl2java - Single WADL resources element is expected


Im not able to use wadl2java and I really need to convert my wadl's to java, it gives me the following exception: java.lang.IllegalStateException: Single WADL resources element is expected

I searched in the internet and found an answer to that problem but it doesn't work, since my namespace is correct.

what I found: How to create a client app for a RESTful service from wadl?

I have some projects from SoapUI and I tried to use the wadl2java tool that SoapUI has: https://www.soapui.org/rest-testing/code-generation.html I followed the instructions, downloaded the project, the project had some errors but resolved it thanks to the issue tracker. after configuring that, when I do the wadl2java in SoapUI it says success but doesn't do a thing...

I tried the maven plugin too that gives me the exception I said above.

I tried downloading the apache cxf and use the wadl2java but same as above...

is there any other way?


Solution

  • You need to provide the path to the WADL file you want to create the Java code from. That's the one mandatory parameter.

    If you still get this error, there may be an issue with the WADL file itself, see here.