12.07.2015 Views

Anyframe CXF Plugin

Anyframe CXF Plugin

Anyframe CXF Plugin

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Asynchronous Invocation@RequestWrapper(localName = "findMovieListAll",targetNamespace = "http://asynch.jaxws.movie.sample.anyframe/asynch_soap_http",className = "anyframe.sample.movie.jaxws.asynch.asynch_soap_http.FindMovieListAll")@WebMethod(operationName = "findMovieListAll")public Future findMovieListAllAsync(@WebParam(name = "asyncHandler", targetNamespace = "")AsyncHandlerasyncHandler);}중략...• Implementation ClassInterface Class를 구현한 구현 클래스로 2개의 findMovieListAllAsync() 메소드에 대해서 빈 내용으로구현 메소드만 작성해놓는다. 실제로 호출되지는 않는다. 다음은 Movie Service의 인터페이스 클래스인 MovieServiceAsynch를 구현한 MovieServiceImpl.java 의 일부이다.@WebService(serviceName = "MovieServiceAsynchService", portName ="MovieServiceAsynchPort", 중략...public class MovieServiceImpl implements MovieServiceAsynch {public List findMovieListAll() throws Exception {return this.movieDAO.findMovieListAll();}public Response findMovieListAllAsync() {return null;/* not called */}public Future findMovieListAllAsync(AsyncHandler asyncHandler) {return null;/* not called */}중략...• Apache <strong>CXF</strong> JaxWsServerFactoryBean 사용한 서버 구동다음은 서버 사이드의 서비스를 Web Services로 노출시키는 서버를 구동하는 코드를 작성 예이다.인터페이스 클래스, 구현 클래스의 인스턴스, Web Services 주소를 JaxWsServerFactoryBean 속성 정보로 설정해준다.MovieServiceImpl implementor = new MovieServiceImpl();JaxWsServerFactoryBean svrFactory=new JaxWsServerFactoryBean();svrFactory.setServiceClass(MovieServiceAsynch.class);svrFactory.setAddress("http://localhost:9002/Movie");svrFactory.setServiceBean(implementor);svrFactory.create();6.2.Client Configuration클라이언트에서 서버 사이드의 Web Services를 호출 시 비동기적으로 호출하여 사용해 보도록 한다.이때, 위에서 Tool을 통해 생성된 Java 코드 중 MovieServiceAsynchService를 이용하여 Web Service에접근한다.46

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

Saved successfully!

Ooh no, something went wrong!