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.

RESTful Services다음은 JAX-RS를 활용하여 RESTful 서비스 구현 시 Server와 Client 단에서 어떻게 사용해야 하는지에대한 사용법이다.• Server Configuration• Client Configuration7.1.1.Server ConfigurationMovie Service를 JAX-WS Frontend나 Simple Frontend를 사용하지 않고 JAX-RS를 지원하는 API를 사용하여 RESTful Web Services로 노출시켜보도록 한다.7.1.1.1.Samples다음은 Movie Service의 인터페이스 클래스 정의에 대한 예제이다.• Interface Class다음은 Movie Service의 인터페이스 클래스를 작성한 MovieService.java 의 일부이다. Annotation 설정에 유의하도록 한다.import javax.ws.rs.Path;import javax.ws.rs.ProduceMime;@Path("/movieservice/")@Produces("application/xml")@XmlSeeAlso(Movie.class)public interface MovieService extends GenericService {@POST@Path("/movie/")public Response createMovie(Movie movie) throws Exception;@GET@Path("/movie/{movieId}/")public Movie getMovie(@PathParam("movieId") String movieId)throws Exception;@PUT@Path("/movie/")public Response updateMovie(Movie movie) throws Exception;@DELETE@Path("/movie/{movieId}/")public Response removeMovie(@PathParam("movieId") String movieId)throws Exception;@GET@Path("/movies")public Movies getList() throws Exception;중략...• Test caseSpring Configuration XML Server 설정 이용JAX-RS를 이용하여 RESTful 서비스를 구현할 때 Spring 설정 파일을 이용하여 서버를 구동시킬 수 있다. 다음은 Spring Configuration XML 예시이다.51

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

Saved successfully!

Ooh no, something went wrong!