Package org.apache.servicemix.soap.api

Examples of org.apache.servicemix.soap.api.InterceptorChain


        msg.setContent(MessageExchange.class, exchange);
        msg.setContent(NormalizedMessage.class, inMsg);
        msg.setContent(OutputStream.class, baos);
        exchange.setProperty(Message.class.getName(), msg);

        InterceptorChain phaseOut = getChain(Phase.ClientOut);
        phaseOut.doIntercept(msg);
        httpExchange.setMethod(HttpMethods.POST);
        httpExchange.setURL(baseUrl);
        httpExchange.setRequestContent(new ByteArrayBuffer(baos.toByteArray()));
        /*
        httpExchange.setRequestEntity(new Entity() {
View Full Code Here


        Message msg = binding.createMessage(req);
        msg.put(JbiConstants.USE_JBI_WRAPPER, useJbiWrapper);
        msg.setContent(MessageExchange.class, exchange);
        msg.setContent(InputStream.class, new ByteArrayInputStream(httpExchange.getResponseData()));
        msg.put(StaxInInterceptor.ENCODING, httpExchange.getResponseEncoding());
        InterceptorChain phaseOut = getChain(Phase.ClientIn);
        phaseOut.doIntercept(msg);
        // TODO: Retrieve headers ?
    }
View Full Code Here

        phaseOut.doIntercept(msg);
        // TODO: Retrieve headers ?
    }

    protected InterceptorChain getChain(Phase phase) {
        InterceptorChain chain = binding.getInterceptorChain(phase);
        if (policies != null) {
            for (int i = 0; i < policies.length; i++) {
                chain.add(policies[i].getInterceptors(phase));
            }
        }
        return chain;
    }
View Full Code Here

        headers.put(HttpConstants.REQUEST_METHOD, method);
        if (HttpConstants.METHOD_POST.equals(method) || HttpConstants.METHOD_PUT.equals(method)) {
            msg.setContent(InputStream.class, request.getInputStream());
        }
        request.setAttribute(Message.class.getName(), msg);
        InterceptorChain phase = getChain(Phase.ServerIn);
        phase.doIntercept(msg);
        return msg.getContent(MessageExchange.class);
    }
View Full Code Here

        msg.setContent(OutputStream.class, response.getOutputStream());
        msg.setContent(MessageExchange.class, exchange);
        msg.setContent(NormalizedMessage.class, outMsg);
        msg.put(SoapVersion.class, in.get(SoapVersion.class));
        msg.put(JbiConstants.USE_JBI_WRAPPER, useJbiWrapper);
        InterceptorChain phase = getChain(Phase.ServerOut);
        phase.doIntercept(msg);
        // TODO: handle http headers: Content-Type, ...
    }
View Full Code Here

        Message msg = binding.createMessage(in);
        msg.setContent(OutputStream.class, response.getOutputStream());
        msg.setContent(MessageExchange.class, exchange);
        msg.put(SoapVersion.class, in.get(SoapVersion.class));
        msg.put(JbiConstants.USE_JBI_WRAPPER, useJbiWrapper);
        InterceptorChain phase = getChain(Phase.ServerOutFault);
        SoapFault soapFault;
        if (error instanceof SoapFault) {
            soapFault = (SoapFault) error;
        } else {
            soapFault = new SoapFault(error);
        }
        msg.setContent(Exception.class, soapFault);
        phase.doIntercept(msg);
    }
View Full Code Here

        msg.setContent(OutputStream.class, response.getOutputStream());
        msg.setContent(MessageExchange.class, exchange);
        msg.setContent(NormalizedMessage.class, fault);
        msg.put(SoapVersion.class, in.get(SoapVersion.class));
        msg.put(JbiConstants.USE_JBI_WRAPPER, useJbiWrapper);
        InterceptorChain phase = getChain(Phase.ServerOutFault);
        QName code = (QName) fault.getProperty("org.apache.servicemix.soap.fault.code");
        String reason = (String) fault.getProperty("org.apache.servicemix.soap.fault.reason");
        SoapFault soapFault = new SoapFault(code, reason, null, null, fault.getContent());
        msg.setContent(Exception.class, soapFault);
        phase.doIntercept(msg);
        // TODO: handle http headers: Content-Type, ...
    }
View Full Code Here

        phase.doIntercept(msg);
        // TODO: handle http headers: Content-Type, ...
    }

    protected InterceptorChain getChain(Phase phase) {
        InterceptorChain chain = binding.getInterceptorChain(phase);
        if (policies != null) {
            for (int i = 0; i < policies.length; i++) {
                chain.add(policies[i].getInterceptors(phase));
            }
        }
        return chain;
    }
View Full Code Here

                if (part.isHeader()) {
                    understoodQNames.add(part.getElement());
                }
            }
        }
        InterceptorChain chain = message.get(InterceptorChain.class);
        for (Interceptor interceptorInstance : chain.getInterceptors()) {
            if (interceptorInstance instanceof SoapInterceptor) {
                SoapInterceptor si = (SoapInterceptor) interceptorInstance;
                serviceRoles.addAll(si.getRoles());
                understoodQNames.addAll(si.getUnderstoodHeaders());
            }
View Full Code Here

                writer.writeEndElement();
            }
            // Write Body
            StaxUtil.writeStartElement(writer, soapVersion.getBody());
            // Write content
            InterceptorChain chain = message.get(InterceptorChain.class);
            chain.doIntercept(message);
            // Close elements
            writer.writeEndElement();
            writer.writeEndElement();
        } catch (XMLStreamException e) {
            throw new Fault(e);
View Full Code Here

TOP

Related Classes of org.apache.servicemix.soap.api.InterceptorChain

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.