Skip to content

Instantly share code, notes, and snippets.

@avvero
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avvero/6a5223324aea725c0303 to your computer and use it in GitHub Desktop.
Save avvero/6a5223324aea725c0303 to your computer and use it in GitHub Desktop.
cxf-servlet.xml for CXF
<?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"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.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" />
<!--REST-->
<bean id="securityRestInterceptor" class="ru.dorofeev22.hospitalcare.ws.interceptors.BasicAuthAuthorizationRestInterceptor">
<property name="users">
<map>
<entry key="username" value="password"/>
</map>
</property>
</bean>
<bean id="patientServiceClass" class="ru.dorofeev22.hospitalcare.ws.rest.service.PatientServiceImpl"/>
<bean id="helloService" class="ru.dorofeev22.hospitalcare.ws.rest.service.HelloService"/>
<jaxrs:server id="patientService" address="/patientService">
<jaxrs:serviceBeans>
<ref bean="patientServiceClass" />
<ref bean="helloService" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
<bean class="ru.dorofeev22.hospitalcare.ws.rest.exception.JsonProcessingExceptionMapper"/>
</jaxrs:providers>
<jaxrs:inInterceptors>
<ref bean="securityRestInterceptor"/>
</jaxrs:inInterceptors>
</jaxrs:server>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment