Package org.switchyard

Examples of org.switchyard.Message.addAttachment()


        message.setContent(content);

        Set<String> attachements = sourceMessage.getAttachmentNames();
        if (!attachements.isEmpty()) {
            for (Entry<String, DataHandler> entry : sourceMessage.getAttachments().entrySet()) {
                message.addAttachment(entry.getKey(), entry.getValue().getDataSource());
            }
        }

        return message;
    }
View Full Code Here


        Message message = exchange.createMessage();
        Context context = exchange.getContext(message);
        context.setProperty("someProp", "somePropVal");
        message.setContent("blah");
        DataSource attach = new TestDataSource("someAttach", "text/plain", "someAttachData");
        message.addAttachment(attach.getName(), attach);
        exchange.send(message);
        Exchange outExchange = handler.waitForOut();
        Assert.assertEquals("true, true, true", outExchange.getMessage().getContent());
    }
View Full Code Here

                ExchangeInjectionTest.TEST_IN_ATTACHMENT);
        Assert.assertNotNull(attachIn);
        Assert.assertEquals(ExchangeInjectionTest.TEST_IN_ATTACHMENT, attachIn.getName());
        Message message = exchange.createMessage();
        message.setContent(ExchangeInjectionTest.TEST_OUT_CONTENT);
        message.addAttachment(ExchangeInjectionTest.TEST_OUT_ATTACHMENT,
                new DummyDataSource(ExchangeInjectionTest.TEST_OUT_ATTACHMENT));
        exchange.send(message);
        return "";
    }
   
View Full Code Here

                if (_mtomEnabled && _xopExpand) {
                    // Using a different map because Camel throws java.lang.StackOverflowError
                    // when we do message.removeAttachment(cid);
                    attachments.put(name, apRequest.getDataHandler().getDataSource());
                } else {
                    message.addAttachment(name, apRequest.getDataHandler().getDataSource());
                }
            }
            if (_mtomEnabled && _xopExpand) {
                // Expand xop message by inlining Base64 content
                bodyNode = SOAPUtil.expandXop((Element)bodyNode, attachments);
View Full Code Here

        getContextMapper().mapFrom(source, exchange.getContext(response));

        Set<String> attachements = source.getMessage().getAttachmentNames();
        if (!attachements.isEmpty()) {
            for (Entry<String, DataHandler> entry : source.getMessage().getAttachments().entrySet()) {
                response.addAttachment(entry.getKey(), entry.getValue().getDataSource());
            }
        }

        // Retrieve SAP response object from body of exchange message.
        Structure flightCustomerGetListResponse = source.getMessage().getBody(Structure.class);
View Full Code Here

        getContextMapper().mapFrom(source, exchange.getContext(response));

        Set<String> attachements = source.getMessage().getAttachmentNames();
        if (!attachements.isEmpty()) {
            for (Entry<String, DataHandler> entry : source.getMessage().getAttachments().entrySet()) {
                response.addAttachment(entry.getKey(), entry.getValue().getDataSource());
            }
        }

        // Retrieve flight connection and passenger info from exchange context property.
        FlightTripRequestInfo flightTripRequestInfo = (FlightTripRequestInfo) exchange.getContext().getProperty(FLIGHT_TRIP_REQUEST_INFO).getValue();
View Full Code Here

        getContextMapper().mapFrom(source, exchange.getContext(response));

        Set<String> attachements = source.getMessage().getAttachmentNames();
        if (!attachements.isEmpty()) {
            for (Entry<String, DataHandler> entry : source.getMessage().getAttachments().entrySet()) {
                response.addAttachment(entry.getKey(), entry.getValue().getDataSource());
            }
        }

        Structure flightConnectionGetDetailResponse = source.getMessage().getBody(Structure.class);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.