Package org.codehaus.xfire.exchange

Examples of org.codehaus.xfire.exchange.InMessage


                    }
                    Source outSrc = me.getOutMessage().getContent();
                    me.setStatus(ExchangeStatus.DONE);
                    channel.send(me);

                    InMessage inMessage = new InMessage(sourceTransformer.toXMLStreamReader(outSrc), getUri());
                    getEndpoint().onReceive(context, inMessage);
                } else {
                    // TODO
                }
               
View Full Code Here


        MessageContext ctx = new MessageContext();
        ctx.setXFire(xfire);
        ctx.setService(service);
        ctx.setProperty(Channel.BACKCHANNEL_URI, out);
        ctx.setExchange(new org.codehaus.xfire.exchange.MessageExchange(ctx));
        InMessage msg = new InMessage();
        ctx.getExchange().setInMessage(msg);
        if (exchange.getOperation() != null) {
            OperationInfo op = service.getServiceInfo().getOperation(exchange.getOperation().getLocalPart());
            if (op != null) {
                ctx.getExchange().setOperation(op);
            }
        }
        ctx.setCurrentMessage(msg);
        NormalizedMessage in = exchange.getMessage("in");
        msg.setXMLStreamReader(getXMLStreamReader(in.getContent()));
        if (in.getAttachmentNames() != null && in.getAttachmentNames().size() > 0) {
            JavaMailAttachments attachments = new JavaMailAttachments();
            for (Iterator it = in.getAttachmentNames().iterator(); it.hasNext();) {
                String name = (String) it.next();
                DataHandler dh = in.getAttachment(name);
                attachments.addPart(new SimpleAttachment(name, dh));
            }
            msg.setAttachments(attachments);
        }
        c.receive(ctx, msg);
        c.close();
       
        // Set response or DONE status
View Full Code Here

                        XFireFault xfireFault = new XFireFault(str, XFireFault.RECEIVER);
                        xfireFault.getDetail().addContent(e);
                        throw xfireFault;
                    } else if (me.getMessage("out") != null) {
                        Source outSrc = me.getMessage("out").getContent();
                        InMessage inMessage = new InMessage(getTransformer().toXMLStreamReader(outSrc), getUri());
                        getEndpoint().onReceive(context, inMessage);
                        me.setStatus(ExchangeStatus.DONE);
                        channel.send(me);
                    }
                }
View Full Code Here

        XMLStreamReader reader = marshaler.createStreamReader(nm);
        if (reader == null) {
            throw new JBIException("Could not get source as XMLStreamReader.");
        }
       
        InMessage in = new InMessage(reader, "");
        MessageContext context = new MessageContext();
        context.setXFire(xfire);
        context.setService(xfire.getServiceRegistry().getService(getService().getLocalPart()));

        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
View Full Code Here

        XMLStreamReader reader = marshaler.createStreamReader(nm);
        if (reader == null) {
            throw new JBIException("Could not get source as XMLStreamReader.");
        }

        InMessage in = new InMessage(reader, "");
        MessageContext context = new MessageContext();
        context.setXFire(xfire);
        context.setService(xfire.getServiceRegistry().getService(getService().getLocalPart()));

        Transport transport = xfire.getTransportManager().getTransport(LocalTransport.BINDING_ID);
View Full Code Here

        XMLStreamReader reader = marshaler.createStreamReader(nm);
        if (reader == null) {
            throw new JBIException("Could not get source as XMLStreamReader.");
        }
       
        InMessage in = new InMessage(reader, "");
        MessageContext context = new MessageContext();
        context.setXFire(xfire);
        context.setService(xfire.getServiceRegistry().getService(getService().getLocalPart()));

        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
View Full Code Here

        XMLStreamReader reader = marshaler.createStreamReader(nm);
        if (reader == null) {
            throw new JBIException("Could not get source as XMLStreamReader.");
        }

        InMessage in = new InMessage(reader, "");
        MessageContext context = new MessageContext();
        context.setXFire(xfire);
        context.setService(xfire.getServiceRegistry().getService(getService().getLocalPart()));

        Transport transport = xfire.getTransportManager().getTransport(LocalTransport.BINDING_ID);
View Full Code Here

        MessageContext ctx = new MessageContext();
        ctx.setXFire(xfire);
        ctx.setService(service);
        ctx.setProperty(Channel.BACKCHANNEL_URI, out);
        ctx.setExchange(new org.codehaus.xfire.exchange.MessageExchange(ctx));
        InMessage msg = new InMessage();
        ctx.getExchange().setInMessage(msg);
        if (exchange.getOperation() != null) {
            OperationInfo op = service.getServiceInfo().getOperation(exchange.getOperation().getLocalPart());
            if (op != null) {
                ctx.getExchange().setOperation(op);
            }
        }
        ctx.setCurrentMessage(msg);
        NormalizedMessage in = exchange.getMessage("in");
        msg.setXMLStreamReader(getXMLStreamReader(in.getContent()));
        if (in.getAttachmentNames() != null && in.getAttachmentNames().size() > 0) {
            JavaMailAttachments attachments = new JavaMailAttachments();
            for (Iterator it = in.getAttachmentNames().iterator(); it.hasNext();) {
                String name = (String) it.next();
                DataHandler dh = in.getAttachment(name);
                attachments.addPart(new SimpleAttachment(name, dh));
            }
            msg.setAttachments(attachments);
        }
        EndpointDeliveryChannel.setEndpoint(endpoint);
        JBIContext.setMessageExchange(exchange);
        if (isInAndOut(exchange)) {
           
View Full Code Here

    {
        for (Iterator itr = factories.iterator(); itr.hasNext();)
        {
            AddressingHeadersFactory factory = (AddressingHeadersFactory) itr.next();

            InMessage msg = context.getInMessage();
            Element header = msg.getHeader();

            if (header != null && factory.hasHeaders(header))
            {

                AddressingHeaders headers = null;
                try
                {
                    headers = factory.createHeaders(header);
                    msg.setProperty(ADRESSING_HEADERS, headers);
                    msg.setProperty(ADRESSING_FACTORY, factory);

                    context.setId(headers.getRelatesTo());

                    // Dispatch the service
                    Service service = getService(headers, context);
View Full Code Here

        String to = packet.getTo();
        String serviceName = to.substring(to.indexOf('/')+1);
        Service service = xfire.getServiceRegistry().getService(serviceName);
       
        InMessage message = new InMessage(new JDOMStreamReader(soapPacket.getDocument().getRootElement()), to);

        MessageContext context = new MessageContext();
        context.setProperty(PACKET, packet);
        context.setXFire(xfire);
        context.setService(service);
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.exchange.InMessage

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.