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()); }
public void startServer(Server server) { if (server.getEndpoint().getBinding() instanceof SoapBinding) { //found a SOAP binding, add the javascript generation interceptor server.getEndpoint().getBinding().getInInterceptors().add(JavascriptGetInterceptor.INSTANCE); } }
@Override public void initialize(Client client, Bus bus) { removeDatabindingInterceptor(client.getEndpoint().getBinding().getInInterceptors()); }
@Override public void initialize(Server server, Bus bus) { removeDatabindingInterceptor(server.getEndpoint().getBinding().getInInterceptors()); }
@Override public void initialize(Client client, Bus bus) { removeDatabindingInterceptor(client.getEndpoint().getBinding().getInInterceptors()); }
@Override public void initialize(Server server, Bus bus) { removeDatabindingInterceptor(server.getEndpoint().getBinding().getInInterceptors()); }
@Override public void initialize(Client client, Bus bus) { removeDatabindingInterceptor(client.getEndpoint().getBinding().getInInterceptors()); }
@Override public void initialize(Client client, Bus bus) { removeDatabindingInterceptor(client.getEndpoint().getBinding().getInInterceptors()); }
@Override public void initialize(Server server, Bus bus) { removeDatabindingInterceptor(server.getEndpoint().getBinding().getInInterceptors()); }
@Override public void initialize(Server server, Bus bus) { removeDatabindingInterceptor(server.getEndpoint().getBinding().getInInterceptors()); }
/** * 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()); } }
@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()); }
@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); }
@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))); } }
@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); }
protected void init() { // configure handlers try { initHandlers(); } catch (final Exception e) { throw new WebServiceException("Error configuring handlers", e); } // Set service to invoke the target ejb service.setInvoker(new EjbMethodInvoker(this.bus, beanContext)); // Remove interceptors that perform handler processing since // handler processing must happen within the EJB container. final Endpoint endpoint = getEndpoint(); removeHandlerInterceptors(bus.getInInterceptors()); removeHandlerInterceptors(endpoint.getInInterceptors()); removeHandlerInterceptors(endpoint.getBinding().getInInterceptors()); removeHandlerInterceptors(endpoint.getService().getInInterceptors()); // Install SAAJ interceptor if (endpoint.getBinding() instanceof SoapBinding && !this.implInfo.isWebServiceProvider()) { endpoint.getService().getInInterceptors().add(new SAAJInInterceptor()); } // Install WSS4J interceptor ConfigureCxfSecurity.configure(endpoint, port); }
public void handleMessage(Message message) throws Fault { Exchange ex = message.getExchange(); Set<Endpoint> endpoints = CastUtils.cast((Set<?>)ex.get(MultipleEndpointObserver.ENDPOINTS)); Endpoint ep = selectEndpoint(message, endpoints); if (ep == null) { return; } ex.put(Endpoint.class, ep); ex.put(Binding.class, ep.getBinding()); ex.put(Service.class, ep.getService()); InterceptorChain chain = message.getInterceptorChain(); chain.add(ep.getInInterceptors()); chain.add(ep.getBinding().getInInterceptors()); chain.add(ep.getService().getInInterceptors()); chain.setFaultObserver(ep.getOutFaultObserver()); }
public void handleMessage(Message message) throws Fault { Exchange ex = message.getExchange(); Set<Endpoint> endpoints = CastUtils.cast((Set<?>)ex.get(MultipleEndpointObserver.ENDPOINTS)); Endpoint ep = selectEndpoint(message, endpoints); if (ep == null) { return; } ex.put(Endpoint.class, ep); ex.put(Binding.class, ep.getBinding()); ex.put(Service.class, ep.getService()); InterceptorChain chain = message.getInterceptorChain(); chain.add(ep.getInInterceptors()); chain.add(ep.getBinding().getInInterceptors()); chain.add(ep.getService().getInInterceptors()); chain.setFaultObserver(ep.getOutFaultObserver()); }
public void handleMessage(Message message) throws Fault { Exchange ex = message.getExchange(); Set<Endpoint> endpoints = CastUtils.cast((Set<?>)ex.get(MultipleEndpointObserver.ENDPOINTS)); Endpoint ep = selectEndpoint(message, endpoints); if (ep == null) { return; } ex.put(Endpoint.class, ep); ex.put(Binding.class, ep.getBinding()); ex.put(Service.class, ep.getService()); InterceptorChain chain = message.getInterceptorChain(); chain.add(ep.getInInterceptors()); chain.add(ep.getBinding().getInInterceptors()); chain.add(ep.getService().getInInterceptors()); chain.setFaultObserver(ep.getOutFaultObserver()); }