<cxf:cxfEndpoint ...>
<cxf:properties>
<entry key="org.apache.camel.cxf.message.headers.relays">
<list>
<ref bean="customHeadersRelay"/>
</list>
</entry>
</cxf:properties>
</cxf:cxfEndpoint>
<bean id="customHeadersRelay" class="org.apache.camel.component.cxf.soap.headers.CustomHeadersRelay"/>
<cxf:cxfEndpoint ...>
<cxf:properties>
<entry key="org.apache.camel.cxf.message.headers.relays">
<list>
<ref bean="customHeadersRelay"/>
</list>
</entry>
</cxf:properties>
</cxf:cxfEndpoint>
<bean id="customHeadersRelay" class="org.apache.camel.component.cxf.soap.headers.CustomHeadersRelay"/>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
@Bean
public HeaderFilterStrategy dropAllMessageHeadersStrategy() {
CxfHeaderFilterStrategy headerFilterStrategy = new CxfHeaderFilterStrategy();
headerFilterStrategy.setRelayHeaders(false);
return headerFilterStrategy;
}
@Bean
public HeaderFilterStrategy dropAllMessageHeadersStrategy() {
CxfHeaderFilterStrategy headerFilterStrategy = new CxfHeaderFilterStrategy();
headerFilterStrategy.setRelayHeaders(false);
return headerFilterStrategy;
}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
@Bean
public CxfEndpoint routerNoRelayEndpoint(HeaderFilterStrategy dropAllMessageHeadersStrategy) {
CxfSpringEndpoint cxfEndpoint = new CxfSpringEndpoint();
cxfEndpoint.setServiceClass(org.apache.camel.component.cxf.soap.headers.HeaderTester.class);
cxfEndpoint.setAddress("/CxfMessageHeadersRelayTest/HeaderService/routerNoRelayEndpoint");
cxfEndpoint.setWsdlURL("soap_header.wsdl");
cxfEndpoint.setEndpointNameAsQName(
QName.valueOf("{http://apache.org/camel/component/cxf/soap/headers}SoapPortNoRelay"));
cxfEndpoint.setServiceNameAsQName(SERVICENAME);
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("dataFormat", "PAYLOAD");
cxfEndpoint.setProperties(properties);
cxfEndpoint.setHeaderFilterStrategy(dropAllMessageHeadersStrategy);
return cxfEndpoint;
}
@Bean
public CxfEndpoint serviceNoRelayEndpoint(HeaderFilterStrategy dropAllMessageHeadersStrategy) {
CxfSpringEndpoint cxfEndpoint = new CxfSpringEndpoint();
cxfEndpoint.setServiceClass(org.apache.camel.component.cxf.soap.headers.HeaderTester.class);
cxfEndpoint.setAddress("http://localhost:" + port + "/services/CxfMessageHeadersRelayTest/HeaderService/routerNoRelayEndpointBackend");
cxfEndpoint.setWsdlURL("soap_header.wsdl");
cxfEndpoint.setEndpointNameAsQName(
QName.valueOf("{http://apache.org/camel/component/cxf/soap/headers}SoapPortNoRelay"));
cxfEndpoint.setServiceNameAsQName(SERVICENAME);
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("dataFormat", "PAYLOAD");
cxfEndpoint.setProperties(properties);
cxfEndpoint.setHeaderFilterStrategy(dropAllMessageHeadersStrategy);
return cxfEndpoint;
}
@Bean
public CxfEndpoint routerNoRelayEndpoint(HeaderFilterStrategy dropAllMessageHeadersStrategy) {
CxfSpringEndpoint cxfEndpoint = new CxfSpringEndpoint();
cxfEndpoint.setServiceClass(org.apache.camel.component.cxf.soap.headers.HeaderTester.class);
cxfEndpoint.setAddress("/CxfMessageHeadersRelayTest/HeaderService/routerNoRelayEndpoint");
cxfEndpoint.setWsdlURL("soap_header.wsdl");
cxfEndpoint.setEndpointNameAsQName(
QName.valueOf("{http://apache.org/camel/component/cxf/soap/headers}SoapPortNoRelay"));
cxfEndpoint.setServiceNameAsQName(SERVICENAME);
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("dataFormat", "PAYLOAD");
cxfEndpoint.setProperties(properties);
cxfEndpoint.setHeaderFilterStrategy(dropAllMessageHeadersStrategy);
return cxfEndpoint;
}
@Bean
public CxfEndpoint serviceNoRelayEndpoint(HeaderFilterStrategy dropAllMessageHeadersStrategy) {
CxfSpringEndpoint cxfEndpoint = new CxfSpringEndpoint();
cxfEndpoint.setServiceClass(org.apache.camel.component.cxf.soap.headers.HeaderTester.class);
cxfEndpoint.setAddress("http://localhost:" + port + "/services/CxfMessageHeadersRelayTest/HeaderService/routerNoRelayEndpointBackend");
cxfEndpoint.setWsdlURL("soap_header.wsdl");
cxfEndpoint.setEndpointNameAsQName(
QName.valueOf("{http://apache.org/camel/component/cxf/soap/headers}SoapPortNoRelay"));
cxfEndpoint.setServiceNameAsQName(SERVICENAME);
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("dataFormat", "PAYLOAD");
cxfEndpoint.setProperties(properties);
cxfEndpoint.setHeaderFilterStrategy(dropAllMessageHeadersStrategy);
return cxfEndpoint;
}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
rom("cxf:bean:routerNoRelayEndpoint")
.to("cxf:bean:serviceNoRelayEndpoint");
rom("cxf:bean:routerNoRelayEndpoint")
.to("cxf:bean:serviceNoRelayEndpoint");
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
@Bean
public HeaderFilterStrategy customMessageFilterStrategy() {
CxfHeaderFilterStrategy headerFilterStrategy = new CxfHeaderFilterStrategy();
List<MessageHeaderFilter> headerFilterList = new ArrayList<MessageHeaderFilter>();
headerFilterList.add(new SoapMessageHeaderFilter());
headerFilterList.add(new CustomHeaderFilter());
headerFilterStrategy.setMessageHeaderFilters(headerFilterList);
return headerFilterStrategy;
}
@Bean
public HeaderFilterStrategy customMessageFilterStrategy() {
CxfHeaderFilterStrategy headerFilterStrategy = new CxfHeaderFilterStrategy();
List<MessageHeaderFilter> headerFilterList = new ArrayList<MessageHeaderFilter>();
headerFilterList.add(new SoapMessageHeaderFilter());
headerFilterList.add(new CustomHeaderFilter());
headerFilterStrategy.setMessageHeaderFilters(headerFilterList);
return headerFilterStrategy;
}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow