`

Apache CXF 学习记录

阅读更多

webservice主要作用是能然后跨语言,跨系统平台进行服务调用,因为它是基于soap协议来传输数据的所以屏蔽了不同编程语音,和系统之间数据传输的差异。

 

1:在与Spring集成的时候会加载三个配置文件

<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 相关的SpringBus,SoapBindingFactory,beanBeanFactoryPostProcessor和BeanPostProcessor。

 

2:cxf服务端接收请求变返回过程

首先请求会被CXFServlet拦截,

然后调用ServletController的invoke方法

然后AbstractHTTPDestination 的invoke

然后ChainInitiationObserver onMessage方法

然后 PhaseInterceptorChain doIntercept 方法执行一系列拦截器,cxf中拦截器是很重要的功能,消息处理返回都是它来负责的,其中处理请求消息是由ServiceInvokerInterceptor这个拦截器通过方法调用目标方法实现。返回输出由MessageSenderInterceptor负责

 

 

 

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics