Buscar este blog

jueves, 12 de marzo de 2020

Camel - CXF - Remove SOAP Headers

import java.util.List;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.cxf.binding.soap.SoapHeader;
import org.apache.cxf.headers.Header;

public class ReaProcessor implements Processor {  
 
 @Override
 public void process(Exchange exchange) throws Exception {
  @SuppressWarnings("unchecked")
  final List<SoapHeader> soapHeaders = (List<SoapHeader>) exchange.getIn().getHeader(Header.HEADER_LIST);
  soapHeaders.clear();   
 }

}
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://camel.apache.org/schema/cxf"
 xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:http="http://cxf.apache.org/transports/http/configuration"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
              http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
              http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
              http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
              http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd">

 <bean id="reaProcessor" class="xxxxxxxxxxx.ReaProcessor"></bean>
 
 <!-- CAMEL CONTEXT -->
 <camelContext id="camelContextRea" xmlns="http://camel.apache.org/schema/spring">
  <!-- CAMEL ROUTE -->
  <route id="ReaWSRoute">
   <description>
    Ruta camel para Rea
   </description>
   
   <from uri="cxf:bean:servicioReaProvider?loggingFeatureEnabled=true&amp;dataFormat=POJO" />
   
   <to uri="cxf:bean:servicioReaClient?loggingFeatureEnabled=true&amp;dataFormat=POJO" />
   
   <process ref="reaProcessor"></process>
  </route>
 </camelContext>

</beans>

No hay comentarios:

Publicar un comentario