Package org.apache.servicemix.soap.api

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


        out.put(Operation.class, request.get(Operation.class));
        return out;
    }
   
    public InterceptorChain getInterceptorChain(Phase phase) {
        InterceptorChain chain = new PhaseInterceptorChain();
        chain.add(getInterceptors(phase));
        return chain;
    }
View Full Code Here


        }
        try {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            message.setContent(OutputStream.class, baos);
            message.put(Message.CONTENT_TYPE, "multipart/related; type=\"text/xml\"; start=\"<" + SOAP_PART_ID + ">\"");
            InterceptorChain chain = message.get(InterceptorChain.class);
            chain.doIntercept(message);
            writeMultipartMessage(message, os, baos.toByteArray());
        } catch (MessagingException e) {
            throw new Fault(e);
        } catch (IOException e) {
            throw new Fault(e);
View Full Code Here

        }
        try {
            // TODO: handle encoding
            XMLStreamWriter writer = StaxUtil.createWriter(os);
            message.setContent(XMLStreamWriter.class, writer);
            InterceptorChain chain = message.get(InterceptorChain.class);
            chain.doIntercept(message);
            writer.flush();
        } catch (XMLStreamException e) {
            throw new Fault(e);
        }
    }
View Full Code Here

        org.apache.servicemix.soap.api.Message msg = binding.createMessage();
        ((Context) jmsContext).msg = msg;
        msg.put(ComponentContext.class, jbiContext);
        msg.put(JbiConstants.USE_JBI_WRAPPER, useJbiWrapper);
        msg.setContent(InputStream.class, new ByteArrayInputStream(((TextMessage) jmsContext.getMessage()).getText().getBytes()));
        InterceptorChain phase = getChain(Phase.ServerIn);
        phase.doIntercept(msg);
        return msg.getContent(MessageExchange.class);
    }
View Full Code Here

        msg.setContent(OutputStream.class, baos);
        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);
        return session.createTextMessage(baos.toString());
    }
View Full Code Here

        msg.setContent(OutputStream.class, baos);
        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);
        return session.createTextMessage(baos.toString());
    }
View Full Code Here

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        msg.setContent(OutputStream.class, baos);
        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);
        return session.createTextMessage(baos.toString());
    }
View Full Code Here

        phase.doIntercept(msg);
        return session.createTextMessage(baos.toString());
    }

    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

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

        InterceptorChain phaseOut = getChain(Phase.ClientOut);
        phaseOut.doIntercept(msg);
        TextMessage jmsMessage = session.createTextMessage();
        jmsMessage.setText(baos.toString());
        return jmsMessage;
    }
View Full Code Here

        msg.setContent(MessageExchange.class, exchange);
        msg.setContent(NormalizedMessage.class, normalizedMessage);
        String str = ((TextMessage) message).getText();
        msg.setContent(InputStream.class, new ByteArrayInputStream(str.getBytes()));

        InterceptorChain phaseIn = getChain(Phase.ClientIn);
        phaseIn.doIntercept(msg);
    }
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.