/**
* Calls the service with the XML content included in the XML element and outputs the XML content
*/
public void call(XSLProcessorContext context, ElemTemplateElement element) throws MessagingException, ParserConfigurationException, TransformerException {
ComponentSupport component = getComponent(context, element);
if (component == null) {
throw new MessagingException("Could not find a component on which to perform the service invocation!");
}
TransformerImpl transformer = context.getTransformer();
PrefixResolver namespaceContext = transformer.getXPathContext().getNamespaceContext();
QName service = getQNameAttribute(namespaceContext, element, "service");
QName interfaceName = getQNameAttribute(namespaceContext, element, "interface");
QName operation = getQNameAttribute(namespaceContext, element, "operation");
InOut outExchange = component.createInOutExchange(service, interfaceName, operation);
NormalizedMessage out = outExchange.createMessage();
outExchange.setInMessage(out);
// lets copy the content into the body
Document document = getTransformer().createDocument();
DOMBuilder builder = new DOMBuilder(document);
transformer.executeChildTemplates(element, context.getContextNode(), context.getMode(), builder);
out.setContent(new DOMSource(document));
// now lets perform the invocation
if (component.getDeliveryChannel().sendSync(outExchange)) {
NormalizedMessage result = outExchange.getOutMessage();
String outVarName = getAttribute(element, "outVar", "out");
transformer.setParameter(outVarName, result);
}
else {