Hey all,
Trying to use the Apache CXF wadl2java tool to generate JAX-RS client bindings for the Stash REST API (and will need to for other Atlassian tools shortly).
It looks like the WADLs listed up on Atlassian's developer pages (here) contains multiple resource definitions, and won't code generate with any wadl2java tools.
Is there a set of REST bindings for Stash available via Maven? I'm integrating a separately hosted app, so don't believe the stash-api artifact is of any use to me.
Failing that, are there any WADL files available that only contain single resource definitions?
Cheers :)
Community moderators have prevented the ability to post new answers.
Hi Will,
How annoying of CXF. We're generating our WADL using Jersey.
Just playing with it locally, it's not got nothing to do with multiple resources (despite the error). From looking at the source, if you change the namespace to xmlns:ns2="http://wadl.dev.java.net/2009/02" it starts to work.
At that point it complains about schema.xsd not being found - you can just delete the <ns2:include href="schema.xsd"/> element.
Then it starts complaining about "WADLToJava Error: Unsupported parameter style" (not very helpful).
You can fix that by changing anything with an empty style="" to 'query' ie:
<ns2:param type="xs:string" style="" name="avatar"
(There should be three param elements missing a style - looks like that's related to our only multipart source for submitting a project avatar)
Also, I using the wadl2java here I managed to get the following to work without having to fix the namespace or params (the include still needed to be removed though).
wadl2java -o . -s jaxrs20 -p my.org stash-rest.wadl.xml
Regarding Maven, you could possibly include stash-api and stash-rest-common as jars in your project, and use our Rest* classes with Jackson, which are used to generate the WADL in the first place.
I hope that helps.
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.