Search in sources :

Example 1 with ConfigureDocLitWrapperInterceptor

use of org.apache.camel.component.cxf.interceptors.ConfigureDocLitWrapperInterceptor in project camel by apache.

the class PayLoadDataFormatFeature method initialize.

@Override
public void initialize(Server server, Bus bus) {
    server.getEndpoint().put("org.apache.cxf.binding.soap.addNamespaceContext", "true");
    server.getEndpoint().getBinding().getInInterceptors().add(new ConfigureDocLitWrapperInterceptor(true));
    if (server.getEndpoint().getBinding() instanceof SoapBinding) {
        server.getEndpoint().getBinding().getOutInterceptors().add(new SetSoapVersionInterceptor());
    }
    // Need to remove some interceptors that are incompatible
    // See above.
    removeInterceptor(server.getEndpoint().getInInterceptors(), HolderInInterceptor.class);
    removeInterceptor(server.getEndpoint().getOutInterceptors(), HolderOutInterceptor.class);
    removeInterceptor(server.getEndpoint().getBinding().getInInterceptors(), SoapHeaderInterceptor.class);
    resetPartTypes(server.getEndpoint().getBinding());
    LOG.info("Initialized CXF Server: {} in Payload mode with allow streaming: {}", server, allowStreaming);
}
Also used : SetSoapVersionInterceptor(org.apache.camel.component.cxf.interceptors.SetSoapVersionInterceptor) ConfigureDocLitWrapperInterceptor(org.apache.camel.component.cxf.interceptors.ConfigureDocLitWrapperInterceptor) SoapBinding(org.apache.cxf.binding.soap.SoapBinding)

Example 2 with ConfigureDocLitWrapperInterceptor

use of org.apache.camel.component.cxf.interceptors.ConfigureDocLitWrapperInterceptor in project camel by apache.

the class PayLoadDataFormatFeature method initialize.

@Override
public void initialize(Client client, Bus bus) {
    client.getEndpoint().put("org.apache.cxf.binding.soap.addNamespaceContext", "true");
    removeFaultInInterceptorFromClient(client);
    // Need to remove some interceptors that are incompatible
    // We don't support JAX-WS Holders for PAYLOAD (not needed anyway)
    // and thus we need to remove those interceptors to prevent Holder
    // object from being created and stuck into the contents list
    // instead of Source objects
    removeInterceptor(client.getEndpoint().getInInterceptors(), HolderInInterceptor.class);
    removeInterceptor(client.getEndpoint().getOutInterceptors(), HolderOutInterceptor.class);
    // The SoapHeaderInterceptor maps various headers onto method parameters.
    // At this point, we expect all the headers to remain as headers, not
    // part of the body, so we remove that one.
    removeInterceptor(client.getEndpoint().getBinding().getInInterceptors(), SoapHeaderInterceptor.class);
    client.getEndpoint().getBinding().getInInterceptors().add(new ConfigureDocLitWrapperInterceptor(true));
    resetPartTypes(client.getEndpoint().getBinding());
    LOG.info("Initialized CXF Client: {} in Payload mode with allow streaming: {}", client, allowStreaming);
}
Also used : ConfigureDocLitWrapperInterceptor(org.apache.camel.component.cxf.interceptors.ConfigureDocLitWrapperInterceptor)

Aggregations

ConfigureDocLitWrapperInterceptor (org.apache.camel.component.cxf.interceptors.ConfigureDocLitWrapperInterceptor)2 SetSoapVersionInterceptor (org.apache.camel.component.cxf.interceptors.SetSoapVersionInterceptor)1 SoapBinding (org.apache.cxf.binding.soap.SoapBinding)1