12.07.2015 Views

Anyframe CXF Plugin

Anyframe CXF Plugin

Anyframe CXF Plugin

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Simple Frontendpublic void updateMovie(Movie movie) throws Exception;public void removeMovie(Movie movie) throws Exception;...중략• Implementation ClassInterface Class를 구현한 구현 클래스로 Web Service 구현과 관련된 부분 없이 작성한다. 다음은 Movie Service의 인터페이스 클래스를 구현한 MovieServiceImpl.java 의 일부이다. 내부적인MovieDAO 를 사용하여 Movie 정보를 관리하고 있다.public class MovieServiceImpl implements MovieService {private MovieDAO movieDAO = null;public void setMovieDAO(MovieDAO movieDAO) {this.movieDAO = movieDAO;}public List findMovieListAll() throws Exception {return this.movieDAO.findMovieListAll();}public Map findMovieMapAll() throws Exception {return this.movieDAO.findMovieMapAll();}public List findMovieList(Country country, Category category)throws Exception {return this.movieDAO.findMovieList(country, category);}public Movie findMovie(String movieId) throws Exception {return this.movieDAO.fineMovie(movieId);}public void createMovie(Movie movie) throws Exception {this.movieDAO.createMovie(movie);}중략...5.2.Server: Simple Frontend API 코드 사용작성된 서비스를 Web Services로 노출시키는 서버를 구동하기 위해서 2가지 방식이 지원된다. 이중Apache <strong>CXF</strong>에서 제공하는 Simple Frontend API 코드를 직접 작성하여 서버를 구동시켜보도록 한다.5.2.1.Samples다음은 Apache <strong>CXF</strong>에서 제공하는 ServerFactoryBean를 직접 이용하여 Movie Service를 Web Service로노출시키는 서버를 구동하는 예제이다.• Apache <strong>CXF</strong> ServerFactoryBean 사용한 서버 구동다음은 서버 사이드의 서비스를 Web Services로 노출시키는 서버를 구동하는 코드 작성 예이다.MovieServiceImpl movieImpl = new MovieServiceImpl();ServerFactoryBean svrFactory = new ServerFactoryBean();svrFactory.setServiceClass(MovieService.class);38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!