Where I can find my WADL? (CXF)

Garry

I have developed a simple RESTful service using Apache CXF coupled in a web application and is working fine.

I Can access it on "http://localhost:8080/SpringRestProjectJava/api/books/1234" and I am also getting the proper JSON response.

My understanding is that from this link that WADL will be autogenerated.

Is it correct? If yes, how can I see WADL for this service.

This is my web.xml

  <servlet>
      <servlet-name>springmvc</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      <init-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>/WEB-INF/CustomSpringConfig.xml</param-value>
      </init-param>      
      <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
      <servlet-name>springmvc</servlet-name>
      <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>simplerest</servlet-name>
    <servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servlet-class>
    <init-param>
        <param-name>jaxrs.serviceClasses</param-name>
        <param-value>org.gsdev.ws.bookservice.BookResource</param-value>
    </init-param>
    <init-param>
        <param-name>jaxrs.providers</param-name>
        <param-value>org.gsdev.ws.bookservice.provider.XstreamJsonProvider</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>simplerest</servlet-name>
    <url-pattern>/api/*</url-pattern>
  </servlet-mapping>

This is my BookResource.java

@Path( "books/{isbn}" )
public class BookResource {

    @GET
    @Produces ( "application/json" )
    public Book getDetails( @PathParam("isbn") String isbn){

        if( isbn.equals( "1234" )){
            Book book = new Book();
            book.setIsbn(isbn);
            book.setTitle("Learning web services by Garry");
            return book;
        }
        return null;
    }
}
Garry

Finally, after keep on trying I am able to make it work. I think its due to the CXFNonSpringJaxrsServlet. I made below changes and I was able to access the autogenerated WADL.

Changes to web.xml

<servlet>
    <servlet-name>simplerest</servlet-name>
    <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>simplerest</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>

Added cxf-servlet.xml in WEB-INF

<jaxrs:server id="bookService" address="/bookservice">
        <jaxrs:serviceBeans>
           <ref bean="bs"/>
        </jaxrs:serviceBeans>
        <jaxrs:providers>
            <ref bean='jsonProvider' />
        </jaxrs:providers>
     </jaxrs:server>

     <bean id="bs" class="org.gsdev.ws.bookservice.BookResource"/> 
     <bean id="jsonProvider" class="org.gsdev.ws.bookservice.provider.XstreamJsonProvider"/>

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Where can I find my Python directory in Ubuntu

분류에서Dev

How can I use Apache CXF 2.6.7 as dependency of my war project and not CXF that is installed in the modules of JBoss 7.1?

분류에서Dev

Where can I find the source of Nautilus?

분류에서Dev

Where can I find the source code of Ubuntu?

분류에서Dev

Where can I find the source code for TempleOS?

분류에서Dev

Apache cxf 용 Wadl 생성

분류에서Dev

How can I find my DHCP server?

분류에서Dev

How can I find my DHCP server?

분류에서Dev

How can I find why system can not run my application?

분류에서Dev

Browser where I can add my own custom CSS or Javascript

분류에서Dev

Where can I access man pages for "aptitude" if it is not on my system?

분류에서Dev

AngularJS: Where can I see $httpBackend responses in my browser directly?

분류에서Dev

Where can I find a driver for a specific HP printer?

분류에서Dev

Where can I find a list of recent updates from Microsoft?

분류에서Dev

Where can i find development documentation for sage saleslogix 7.5

분류에서Dev

Where can I find official POSIX and UNIX documentation?

분류에서Dev

Where can I find the Pictures / Music / Downloads folder icons?

분류에서Dev

Where can I find Spring 4 OSGi bundles

분류에서Dev

where can I find matrix like chart for ios frameworks

분류에서Dev

Where can I find MongoDB documents created inside Meteor?

분류에서Dev

Where can I find a zip.exe (that works in Windows 7)?

분류에서Dev

Where can I find MongoDB documents created inside Meteor?

분류에서Dev

Where can I find the screenlog.0 file?

분류에서Dev

Where can I find the historical source code of the Linux sources

분류에서Dev

Where can I find a list of USB error codes?

분류에서Dev

Where can I find external.php file in vBulletin?

분류에서Dev

Where can I find oracle XE 10g packages

분류에서Dev

Where I can find MariaDB protocol document that different from MySQL

분류에서Dev

Where can I find a complete reference for the $PS1 variable?

Related 관련 기사

  1. 1

    Where can I find my Python directory in Ubuntu

  2. 2

    How can I use Apache CXF 2.6.7 as dependency of my war project and not CXF that is installed in the modules of JBoss 7.1?

  3. 3

    Where can I find the source of Nautilus?

  4. 4

    Where can I find the source code of Ubuntu?

  5. 5

    Where can I find the source code for TempleOS?

  6. 6

    Apache cxf 용 Wadl 생성

  7. 7

    How can I find my DHCP server?

  8. 8

    How can I find my DHCP server?

  9. 9

    How can I find why system can not run my application?

  10. 10

    Browser where I can add my own custom CSS or Javascript

  11. 11

    Where can I access man pages for "aptitude" if it is not on my system?

  12. 12

    AngularJS: Where can I see $httpBackend responses in my browser directly?

  13. 13

    Where can I find a driver for a specific HP printer?

  14. 14

    Where can I find a list of recent updates from Microsoft?

  15. 15

    Where can i find development documentation for sage saleslogix 7.5

  16. 16

    Where can I find official POSIX and UNIX documentation?

  17. 17

    Where can I find the Pictures / Music / Downloads folder icons?

  18. 18

    Where can I find Spring 4 OSGi bundles

  19. 19

    where can I find matrix like chart for ios frameworks

  20. 20

    Where can I find MongoDB documents created inside Meteor?

  21. 21

    Where can I find a zip.exe (that works in Windows 7)?

  22. 22

    Where can I find MongoDB documents created inside Meteor?

  23. 23

    Where can I find the screenlog.0 file?

  24. 24

    Where can I find the historical source code of the Linux sources

  25. 25

    Where can I find a list of USB error codes?

  26. 26

    Where can I find external.php file in vBulletin?

  27. 27

    Where can I find oracle XE 10g packages

  28. 28

    Where I can find MariaDB protocol document that different from MySQL

  29. 29

    Where can I find a complete reference for the $PS1 variable?

뜨겁다태그

보관