applicationContext-cxf-server.xml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core"
  4. xsi:schemaLocation="http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
  5. default-lazy-init="true">
  6. <description>Apache CXF Web Service服务端配置</description>
  7. <import resource="classpath:META-INF/cxf/cxf.xml" />
  8. <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
  9. <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
  10. <!-- jax-ws endpoint定义 -->
  11. <!-- 使用WS-Security中的明文密码认证机制的Endpoint -->
  12. <jaxws:endpoint id="userServiceWithPlainPasswordEP" address="/UserServiceWithPlainPassword">
  13. <jaxws:implementor ref="userWebService" />
  14. <jaxws:inInterceptors>
  15. <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
  16. <property name="properties">
  17. <map>
  18. <entry key="action" value="UsernameToken" />
  19. <entry key="passwordType" value="PasswordText" />
  20. <entry key="passwordCallbackRef" value-ref="plainPasswordCallback" />
  21. </map>
  22. </property>
  23. </bean>
  24. </jaxws:inInterceptors>
  25. </jaxws:endpoint>
  26. <!-- 使用WS-Security中的Digest密码认证机制的Endpoint -->
  27. <jaxws:endpoint id="userServiceWithDigestPasswordEP" address="/UserServiceWithDigestPassword">
  28. <jaxws:implementor ref="userWebService" />
  29. <jaxws:inInterceptors>
  30. <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
  31. <property name="properties">
  32. <map>
  33. <entry key="action" value="UsernameToken" />
  34. <entry key="passwordType" value="PasswordDigest" />
  35. <entry key="passwordCallbackRef" value-ref="digestPasswordCallback" />
  36. </map>
  37. </property>
  38. </bean>
  39. </jaxws:inInterceptors>
  40. </jaxws:endpoint>
  41. <!-- 使用WS-Security中的明文密码认证机制并结合SpringSecurity控制权限的Endpoint -->
  42. <jaxws:endpoint id="userServiceWithSpringSecurityEP" address="/UserServiceWithSpringSecurity">
  43. <jaxws:implementor ref="userWebService" />
  44. <jaxws:inInterceptors>
  45. <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
  46. <property name="properties">
  47. <map>
  48. <entry key="action" value="UsernameToken" />
  49. <entry key="passwordType" value="PasswordText" />
  50. <entry key="passwordCallbackRef" value-ref="plainPasswordCallback" />
  51. </map>
  52. </property>
  53. </bean>
  54. <bean class="org.springside.modules.security.springsecurity.cxf.SpringSecurityInInterceptor">
  55. <property name="userDetailsService" ref="userDetailsService" />
  56. </bean>
  57. <bean class="org.springside.modules.security.springsecurity.cxf.SpringSecurityOutInterceptor" />
  58. </jaxws:inInterceptors>
  59. </jaxws:endpoint>
  60. <!-- 使用Base64Binary传输二进制内容的endpoint定义 -->
  61. <jaxws:endpoint id="smallImageServiceEP" address="/SmallImageService">
  62. <jaxws:implementor ref="smallImageWebService" />
  63. </jaxws:endpoint>
  64. <!-- 使用MTOM传输二进制内容的endpoint定义 -->
  65. <jaxws:endpoint id="largeimageServiceEP" address="/LargeImageService">
  66. <jaxws:implementor ref="largeImageWebService" />
  67. <jaxws:properties>
  68. <entry key="mtom-enabled" value="true" />
  69. </jaxws:properties>
  70. </jaxws:endpoint>
  71. <!-- UserWebService的实现Bean定义 -->
  72. <bean id="userWebService" class="com.pentair.showcase.ws.server.impl.UserWebServiceImpl" />
  73. <!-- SmallImageWebService的实现Bean定义 -->
  74. <bean id="smallImageWebService" class="com.pentair.showcase.ws.server.impl.SmallImageWebServiceImpl" />
  75. <!-- LargeImageWebService的实现Bean定义 -->
  76. <bean id="largeImageWebService" class="com.pentair.showcase.ws.server.impl.LargeImageWebServiceImpl" />
  77. <!-- dozer DTO复制工具类定义 -->
  78. <bean id="dozer" class="org.dozer.DozerBeanMapper" />
  79. <!-- 明文密码处理Bean定义 -->
  80. <bean id="plainPasswordCallback" class="com.pentair.showcase.ws.server.impl.security.PlainPasswordCallback" />
  81. <!-- Digest密码处理Bean定义 -->
  82. <bean id="digestPasswordCallback" class="com.pentair.showcase.ws.server.impl.security.DigestPasswordCallback" />
  83. </beans>