receiveMessageBean = new ReceiveMessageAction();
receiveMessageBean.setEndpoint(endpoint);
receiveMessageBean.setValidator(validator);
PayloadTemplateMessageBuilder controlMessageBuilder = new PayloadTemplateMessageBuilder();
XmlMessageValidationContext validationContext = new XmlMessageValidationContext();
validationContext.setMessageBuilder(controlMessageBuilder);
controlMessageBuilder.setPayloadData("<root>"
+ "<element attributeA='attribute-value' attributeB='attribute-value' >"
+ "<sub-elementA attribute='A'>text-value</sub-elementA>"
+ "<sub-elementB attribute='B'>text-value</sub-elementB>"
+ "<sub-elementC attribute='C'>text-value</sub-elementC>"
+ "</element>"
+ "</root>");
HashMap<String, Object> validateHeaderValues = new HashMap<String, Object>();
validateHeaderValues.put("header-valueA", "A");
validateHeaderValues.put("header-valueB", "B");
validateHeaderValues.put("header-valueC", "C");
controlMessageBuilder.setMessageHeaders(validateHeaderValues);
List<ValidationContext> validationContexts = new ArrayList<ValidationContext>();
validationContexts.add(validationContext);
receiveMessageBean.setValidationContexts(validationContexts);
receiveMessageBean.execute(context);