2010. 6. 28. 15:35
우선은 JAX-WS 에서 soap 과 http binding 의 endpoint sample을 올린다. http binding은 RS 가 좀더 낳다는 의견이 많지만, soap과 같이 서비스하며, 코드를 재사용할 수 있다는 장점 때문에 WS를 사용하게 됨.
sample
sample
<?xml version="1.0" encoding="UTF-8"?>
<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-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml" />
<!-- The service bean -->
<bean id="demoServiceImpl" class="cxf.demo.service.DemoServiceImpl" />
<jaxws:endpoint id="getServiceHttp"
implementor="#demoServiceImpl"
implementorClass="cxf.demo.service.DemoService"
address="/DemoService"
bindingUri="http://apache.org/cxf/binding/http">
<jaxws:serviceFactory>
<ref bean="jaxWsServiceFactoryBean"/>
</jaxws:serviceFactory>
</jaxws:endpoint>
<jaxws:endpoint
id="getServiceSoap"
implementor="#demoServiceImpl"
implementorClass="cxf.demo.service.DemoService"
address="/DemoService/soap" />
<bean id="jaxWsServiceFactoryBean"
class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean" scope="prototype">
<property name="wrapped" value="false" />
</bean>
</beans>
<!-- END SNIPPET: beans -->
<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-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml" />
<!-- The service bean -->
<bean id="demoServiceImpl" class="cxf.demo.service.DemoServiceImpl" />
<jaxws:endpoint id="getServiceHttp"
implementor="#demoServiceImpl"
implementorClass="cxf.demo.service.DemoService"
address="/DemoService"
bindingUri="http://apache.org/cxf/binding/http">
<jaxws:serviceFactory>
<ref bean="jaxWsServiceFactoryBean"/>
</jaxws:serviceFactory>
</jaxws:endpoint>
<jaxws:endpoint
id="getServiceSoap"
implementor="#demoServiceImpl"
implementorClass="cxf.demo.service.DemoService"
address="/DemoService/soap" />
<bean id="jaxWsServiceFactoryBean"
class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean" scope="prototype">
<property name="wrapped" value="false" />
</bean>
</beans>
<!-- END SNIPPET: beans -->
'framework > apache cxf' 카테고리의 다른 글
[Apache cxf] - session support (0) | 2010.06.28 |
---|---|
[Apache cxf] - WSDL to Java (0) | 2010.06.28 |
[Apache cxf] cxf, axis2, metro 성능 비교 (0) | 2010.06.28 |
[Apache cxf] - client remote ip 가져오자 (1) | 2010.06.28 |
[CXF] - cxf 소개 (0) | 2010.06.28 |