-- beans.xml --

<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:jaxws="http://cxf.apache.org/jaxws"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                    http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
 
 <import resource="classpath:META-INF/cxf/cxf.xml" />
 <import resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml" />
 <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
 <jaxws:endpoint
  id="cxfservice"
  implementor="kr.co.gnnet.cxf.CXFServiceImpl"
  address="/CXFServicePort" <-- 서비스 호출시 URL과 연관
  bindingUri="http://apache.org/cxf/binding/http" >
    <jaxws:serviceFactory >
     <bean class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean">
      <property name="wrapped" value="true" /> <-- Step7에서 추가 설명 있슴
     </bean>
    </jaxws:serviceFactory >
 </jaxws:endpoint >
 
</beans>




-- web.xml --

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">

 

  <display-name>REST</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <description>Apache CXF Endpoint</description>
    <display-name>cxf</display-name>
    <servlet-name>cxf</servlet-name>
    <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>cxf</servlet-name>
    <url-pattern>/services/-</url-pattern>
  </servlet-mapping>
  <session-config>
    <session-timeout>60</session-timeout>
  </session-config>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>WEB-INF/beans.xml</param-value>
  </context-param>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

</web-app>

'JAVA > Webservice(REST)' 카테고리의 다른 글

07. POST 방식 호출  (0) 2015.08.06
06. 서비스 호출  (0) 2015.08.06
04. 프로젝트의 시작  (0) 2015.08.06
03. Eclipse 환경설정  (0) 2015.08.06
02. 개발환경  (0) 2015.08.06

+ Recent posts