Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6238

Java2WADL : Generating response status attribute

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.3
    • 3.0.4, 3.1
    • JAX-RS
    • None
    • JavaSE 1.7, JAX-RS 2.0

    • Unknown

    Description

      Would it be possible to get the WADL element attribute "status" be generated when using javax.ws.rs.core.StatusType interface and the Response builder ?

      Here is the definition of the resource.

      resourceexample.java
         @GET
          @Path("/{id}")
          @Produces(MediaType.APPLICATION_JSON)
          @NoCache
          public Response getPermis(@PathParam("id") String id) {
              return Response.status(Status.NOT_IMPLEMENTED).build();
          }
      

      The cxf-java2wadl-plugin configuration in the Maven Pom file

      	      <plugin>
      	      	<groupId>org.apache.cxf</groupId>
      			<artifactId>cxf-java2wadl-plugin</artifactId>
      			<version>3.0.3</version>
      			<dependencies>
      				<dependency>
        				<groupId>org.apache.cxf</groupId>
        				<artifactId>cxf-rt-rs-service-description</artifactId>
        				<version>3.0.3</version>
      			</dependency>
      			</dependencies>
      			<executions>
                          <execution>
                              <id>parsejavadoc</id>
                              <phase>generate-sources</phase>
                              <goals>
                                  <goal>parsejavadoc</goal>
                              </goals>
                          </execution>
                          <execution>
                              <id>process-classes</id>
                              <phase>process-classes</phase>
                              <goals>
                                  <goal>java2wadl</goal>
                              </goals>
                              <configuration>
      				            <applicationTitle>APIREST</applicationTitle>
      				            <namespacePrefix>peTestCXF</namespacePrefix>
      				            <addResourceAndMethodIds>true</addResourceAndMethodIds>
      				            <linkAnyMediaTypeToXmlSchema>true</linkAnyMediaTypeToXmlSchema>
      							<singleResourceMultipleMethods>false</singleResourceMultipleMethods>
      							<classResourceNames>
      								<classResourceName>fr.pe.internet.de.references.api.ressources.Permis</classResourceName>
      							</classResourceNames>
      <!-- 							<classResourceNames/> -->
      <!-- 							<basePackages>fr.pe.internet.de.references.api.ressources</basePackages> -->
                                  <docProvider>org.apache.cxf.maven_plugin.javatowadl.ResourceMapJavaDocProvider</docProvider>
                                  <attachWadl>true</attachWadl>
                              </configuration>
                          </execution>
                      </executions>
      	      </plugin>

      The generated WADL file :

      <application xmlns="http://wadl.dev.java.net/2009/02" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <doc title="APIREST"/>
      <grammars></grammars>
      <resources base="/">
        <resource path="/permis" id="fr.pe.internet.de.references.api.ressources.Permis">
          <resource path="/{id}">
            <param name="id" style="template" type="xs:string">
            </param>
            <method name="GET" id="getPermis">
              <request>
              </request>
              <response>
                <representation mediaType="application/json">
                </representation>
              </response>
            </method>
          </resource>
        </resource>
      </resources>
      </application>
      

      Cheers,
      Bertrand.

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            bertrandR@PE Bertrand Renault
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: