读书人

CXF bus interceptor配备

发布时间: 2012-10-08 19:54:56 作者: rapoo

CXF bus interceptor配置

作用:BUS是cxf的支架,它主要担当扩展及拦截器提供者的角色。

?

在这里主要讲讲 bus的interceptor的功能

目前配置cxf的interceptor主要有2中方法:

1、通过xml配置文件的方法,使用<?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:cxf="http://cxf.apache.org/core" xsi:schemaLocation="http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsdhttp://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.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" /><!-- CXF IP地址输入拦截器 --> <bean id="ipAddressInInterceptor" /> <!-- 全局Bus(输入拦截器) --> <cxf:bus> <cxf:inInterceptors> <ref bean="ipAddressInInterceptor" /> </cxf:inInterceptors> </cxf:bus> <jaxws:endpoint id="helloWorld" implementor="demo.spring.HelloWorldImpl" address="/HelloWorld" /> </beans>把bus的那个加上 后 jaxws标签就认不出来了<?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:cxf="http://cxf.apache.org/core" xsi:schemaLocation="http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsdhttp://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.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" /><!-- CXF IP地址输入拦截器 --> <bean id="ipAddressInInterceptor" /> <!-- 全局Bus(输入拦截器) --> <cxf:bus> <cxf:inInterceptors> <ref bean="ipAddressInInterceptor" /> </cxf:inInterceptors> </cxf:bus> <jaxws:endpoint id="helloWorld" implementor="demo.spring.HelloWorldImpl" address="/HelloWorld" /> </beans>把bus的那个加上 后 jaxws标签就认不出来了
不会的

读书人网 >软件架构设计

热点推荐