private void removeDatabindingInterceptprs() { for (Interceptor interceptor : ep.getBinding().getInInterceptors()) { if (interceptor.getClass().getName().equals("org.apache.cxf.interceptor.DocLiteralInInterceptor") || interceptor.getClass().getName().equals("org.apache.cxf.binding.soap.interceptor.SoapHeaderInterceptor") || interceptor.getClass().getName().equals("org.apache.cxf.binding.soap.interceptor.RPCInInterceptor")) { ep.getBinding().getInInterceptors().remove(interceptor); } } for (Interceptor interceptor : ep.getBinding().getOutInterceptors()) { if (interceptor.getClass().getName().equals("org.apache.cxf.interceptor.WrappedOutInterceptor") || interceptor.getClass().getName().equals("org.apache.cxf.interceptor.BareOutInterceptor")) { ep.getBinding().getOutInterceptors().remove(interceptor); } } }
private void removeUnnecessaryCxfInterceptors(Client client) { Binding binding = client.getEndpoint().getBinding(); removeInterceptor(binding.getOutInterceptors(), WrappedOutInterceptor.class.getName()); removeInterceptor(binding.getInInterceptors(), Soap11FaultInInterceptor.class.getName()); removeInterceptor(binding.getInInterceptors(), Soap12FaultInInterceptor.class.getName()); removeInterceptor(binding.getInInterceptors(), CheckFaultInterceptor.class.getName()); }
/** * @param endpoint * @param cache * @return */ protected PhaseInterceptorChain buildRetransmitChain(final Endpoint endpoint, PhaseChainCache cache) { PhaseInterceptorChain retransmitChain; Bus bus = getManager().getBus(); List<Interceptor<? extends Message>> i1 = bus.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by bus: " + i1); } List<Interceptor<? extends Message>> i2 = endpoint.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by endpoint: " + i2); } List<Interceptor<? extends Message>> i3 = endpoint.getBinding().getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by binding: " + i3); } PhaseManager pm = bus.getExtension(PhaseManager.class); retransmitChain = cache.get(pm.getOutPhases(), i1, i2, i3); return retransmitChain; }
protected PhaseInterceptorChain setupInterceptorChain(Endpoint endpoint) { PhaseManager pm = bus.getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = bus.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by bus: " + i1); } List<Interceptor<? extends Message>> i2 = getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by client: " + i2); } List<Interceptor<? extends Message>> i3 = endpoint.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by endpoint: " + i3); } List<Interceptor<? extends Message>> i4 = endpoint.getBinding().getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by binding: " + i4); } List<Interceptor<? extends Message>> i5 = null; if (endpoint.getService().getDataBinding() instanceof InterceptorProvider) { i5 = ((InterceptorProvider)endpoint.getService().getDataBinding()).getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by databinding: " + i5); } } if (i5 != null) { return outboundChainCache.get(pm.getOutPhases(), i1, i2, i3, i4, i5); } return outboundChainCache.get(pm.getOutPhases(), i1, i2, i3, i4); }
/** * When the binding style is RPC we need to replace the default interceptors to avoid truncating the content. */ private void replaceRPCInterceptors(Server server) { if(CxfUtils.removeInterceptor(server.getEndpoint().getBinding().getInInterceptors(), RPCInInterceptor.class.getName())) { server.getEndpoint().getBinding().getInInterceptors().add(new ProxyRPCInInterceptor()); } if(CxfUtils.removeInterceptor(server.getEndpoint().getBinding().getOutInterceptors(), RPCOutInterceptor.class.getName())) { server.getEndpoint().getBinding().getOutInterceptors().add(new BareOutInterceptor()); } }
protected PhaseInterceptorChain setupInterceptorChain(Endpoint endpoint) { PhaseManager pm = bus.getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = bus.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by bus: " + i1); } List<Interceptor<? extends Message>> i2 = getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by client: " + i2); } List<Interceptor<? extends Message>> i3 = endpoint.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by endpoint: " + i3); } List<Interceptor<? extends Message>> i4 = endpoint.getBinding().getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by binding: " + i4); } List<Interceptor<? extends Message>> i5 = null; if (endpoint.getService().getDataBinding() instanceof InterceptorProvider) { i5 = ((InterceptorProvider)endpoint.getService().getDataBinding()).getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by databinding: " + i5); } } if (i5 != null) { return outboundChainCache.get(pm.getOutPhases(), i1, i2, i3, i4, i5); } return outboundChainCache.get(pm.getOutPhases(), i1, i2, i3, i4); }
protected PhaseInterceptorChain setupInterceptorChain(Endpoint endpoint) { PhaseManager pm = bus.getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = bus.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by bus: " + i1); } List<Interceptor<? extends Message>> i2 = getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by client: " + i2); } List<Interceptor<? extends Message>> i3 = endpoint.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by endpoint: " + i3); } List<Interceptor<? extends Message>> i4 = endpoint.getBinding().getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by binding: " + i4); } List<Interceptor<? extends Message>> i5 = null; if (endpoint.getService().getDataBinding() instanceof InterceptorProvider) { i5 = ((InterceptorProvider)endpoint.getService().getDataBinding()).getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by databinding: " + i5); } } if (i5 != null) { return outboundChainCache.get(pm.getOutPhases(), i1, i2, i3, i4, i5); } return outboundChainCache.get(pm.getOutPhases(), i1, i2, i3, i4); }
protected PhaseInterceptorChain setupInterceptorChain(Endpoint endpoint) { PhaseManager pm = bus.getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = bus.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by bus: " + i1); } List<Interceptor<? extends Message>> i2 = getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by client: " + i2); } List<Interceptor<? extends Message>> i3 = endpoint.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by endpoint: " + i3); } List<Interceptor<? extends Message>> i4 = endpoint.getBinding().getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by binding: " + i4); } List<Interceptor<? extends Message>> i5 = null; if (endpoint.getService().getDataBinding() instanceof InterceptorProvider) { i5 = ((InterceptorProvider)endpoint.getService().getDataBinding()).getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by databinding: " + i5); } } if (i5 != null) { return outboundChainCache.get(pm.getOutPhases(), i1, i2, i3, i4, i5); } return outboundChainCache.get(pm.getOutPhases(), i1, i2, i3, i4); }
il = binding.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by binding: " + il);
il = binding.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by binding: " + il);
il = binding.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by binding: " + il);
il = binding.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by binding: " + il);
@Override public void initialize(Client client, Bus bus) { //check if there is logging interceptor removeInterceptorWhichIsOutThePhases(client.getInInterceptors(), REMAINING_IN_PHASES, getInInterceptorNames()); removeInterceptorWhichIsOutThePhases(client.getEndpoint().getInInterceptors(), REMAINING_IN_PHASES, getInInterceptorNames()); client.getEndpoint().getBinding().getInInterceptors().clear(); //we need to keep the LoggingOutputInterceptor getOutInterceptorNames().add(LoggingOutInterceptor.class.getName()); removeInterceptorWhichIsOutThePhases(client.getOutInterceptors(), REMAINING_OUT_PHASES, getOutInterceptorNames()); removeInterceptorWhichIsOutThePhases(client.getEndpoint().getOutInterceptors(), REMAINING_OUT_PHASES, getOutInterceptorNames()); client.getEndpoint().getBinding().getOutInterceptors().clear(); client.getEndpoint().getOutInterceptors().add(new RawMessageContentRedirectInterceptor()); }
i4 = binding.getOutInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by binding: " + i4);
@Override protected void configureServer(Server server) { if (isProxyEnvelope()) { CxfUtils.removeInterceptor(server.getEndpoint().getBinding().getOutInterceptors(), SoapOutInterceptor.class.getName()); } CxfUtils.removeInterceptor(server.getEndpoint().getBinding().getInInterceptors(), MustUnderstandInterceptor.class.getName()); replaceRPCInterceptors(server); if (isValidationEnabled()) { server.getEndpoint().getInInterceptors().add(new ProxySchemaValidationInInterceptor(getConfiguration().getCxfBus(), server.getEndpoint(), server.getEndpoint().getService().getServiceInfos().get(0))); } }
CxfUtils.removeInterceptor(binding.getOutInterceptors(), WrappedOutInterceptor.class.getName()); CxfUtils.removeInterceptor(binding.getInInterceptors(), Soap11FaultInInterceptor.class.getName()); CxfUtils.removeInterceptor(binding.getInInterceptors(), Soap12FaultInInterceptor.class.getName()); CxfUtils.removeInterceptor(binding.getOutInterceptors(), SoapOutInterceptor.class.getName()); client.getInInterceptors().add(new ReversibleStaxInInterceptor()); client.getInInterceptors().add(new ResetStaxInterceptor());
protected InterceptorChain setupInterceptorChain(Exchange exchange) { if (outgoingInterceptorChain != null) { return outgoingInterceptorChain; } Endpoint endpoint = getEndpoint(exchange); PhaseManager pm = bus.getExtension(PhaseManager.class); @SuppressWarnings("unchecked") List<Interceptor<? extends org.apache.cxf.message.Message>> i1 = bus.getOutInterceptors(); @SuppressWarnings("unchecked") List<Interceptor<? extends org.apache.cxf.message.Message>> i2 = endpoint.getOutInterceptors(); @SuppressWarnings("unchecked") List<Interceptor<? extends org.apache.cxf.message.Message>> i3 = getOutInterceptors(); @SuppressWarnings("unchecked") List<Interceptor<? extends org.apache.cxf.message.Message>> i4 = endpoint.getBinding().getOutInterceptors(); PhaseInterceptorChain phaseInterceptorChain = outboundChainCache.get(pm .getOutPhases(), i1, i2, i3, i4); return phaseInterceptorChain; }
server.getEndpoint().getBinding().getOutInterceptors().clear(); server.getEndpoint().getOutInterceptors().add(new RawMessageContentRedirectInterceptor());
@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); }
jaxwsEndpoint.getBinding().getOutInterceptors().add(new TestAttachmentOutInterceptor()); jaxwsEndpoint.getBinding().getOutInterceptors().add(new LoggingOutInterceptor());