Hi all,

I am having a strange case of where despite the response being defined, the 
code generated by wadl2java returns void instead.

The generated code looks like this:

    @POST
    @Consumes("application/x-www-form-urlencoded")
    @Path("/password/{mail}")
    void changePassword(@PathParam("mail") String mail, 
@FormParam("currentPassword") String currentPassword, 
@FormParam("userPassword") String userPassword);

(Note the void instead of Response)

The wadl looks like this:

      <resource path="password">
        <resource path="{mail}">
          <method name="POST" id="changePassword">
            <doc>Change the user's password</doc>
            <request>
              <param required="true" style="template" name="mail"/>
              <representation mediaType="application/x-www-form-urlencoded">
                <param name="currentPassword" style="query" type="xsd:string"/>
                <param name="userPassword" style="query" type="xsd:string"/>
              </representation>
            </request>
            <response status="204">
              <doc>If the password change was success, return 204.</doc>
            </response>
            <response status="400" mediaType="application/json" 
element="error:error">
                  <representation mediaType="application/json" 
element="error:error"/>
              <doc>Invalid input strings, error message returned in "error" 
property</doc>
            </response>
            <response status="403" mediaType="application/json" 
element="error:error">
                  <representation mediaType="application/json" 
element="error:error"/>
              <doc>The current password was wrong</doc>
            </response>
            <response status="404" mediaType="application/json" 
element="error:error">
                  <representation mediaType="application/json" 
element="error:error"/>
              <doc>User not found</doc>
            </response>
          </method>
        </resource>

The closest I can find is this bug, marked as fixed in v2.4.2: 
https://issues.apache.org/jira/browse/CXF-3662

Can anyone see something obvious where I am going wrong?

Regards,
Graham
--

Reply via email to