private static Element toElement(Source src) throws Fault { try { SourceTransformer transformer = new SourceTransformer(); Element ret = transformer.toDOMElement(src); ret = removeEmptyDefaultTns(ret); return ret; } catch (Exception e) { throw new Fault(e); } }
public void buildAggregate(Object aggregation, NormalizedMessage message, MessageExchange exchange, boolean doTimeout) throws Exception { NormalizedMessage[] messages = ((SplitterAggregation) aggregation).messages; String correlationId = ((SplitterAggregation) aggregation).correlationId; SourceTransformer st = new SourceTransformer(); Document doc = st.createDocument(); Element root = createChildElement(aggregateElementName, doc); root.setAttribute(countAttribute, Integer.toString(messages.length)); for (int i = 0; i < messages.length; i++) { if (messages[i] != null) { Element elem = st.toDOMElement(messages[i]); if (messageElementName != null) { Element msg = createChildElement(messageElementName, root); msg.setAttribute(indexAttribute, Integer.toString(i)); msg.appendChild(doc.importNode(elem, true)); } else { root.appendChild(doc.importNode(elem, true)); } if (isCopyProperties()) { copyProperties(messages[i], message); } if (isCopyAttachments()) { copyAttachments(messages[i], message); } } } message.setContent(new DOMSource(doc)); message.setProperty(AbstractSplitter.SPLITTER_CORRID, correlationId); }
Element element = new SourceTransformer().toDOMElement(nm.getContent());
protected void validateMessage(SoapMessage message) throws Fault { Service service = ServiceModelUtil.getService(message.getExchange()); if (service != null) { Schema schema = EndpointReferenceUtils.getSchema(service.getServiceInfos().get(0)); if (schema != null) { javax.xml.validation.Validator validator = schema.newValidator(); try { Element sourceMessage = new SourceTransformer().toDOMElement(message.getContent(Source.class)); message.setContent(Source.class, new DOMSource(sourceMessage)); if (!useJBIWrapper && !useSOAPEnvelope) { validator.validate(new DOMSource(sourceMessage)); } else { Element partWrapper = DomUtil .getFirstChildElement(sourceMessage); while (partWrapper != null) { Element partContent = DomUtil .getFirstChildElement(partWrapper); validator.validate(new DOMSource(partContent)); partWrapper = DomUtil .getNextSiblingElement(partWrapper); } } } catch (Exception e) { throw new Fault(e); } } } }
Element element = new SourceTransformer().toDOMElement(nm.getContent());
element = new SourceTransformer().toDOMElement(source); } catch (Exception e) { throw new Fault(e);
element = new SourceTransformer().toDOMElement(source); } catch (Exception e) { throw new Fault(e);
Element element = new SourceTransformer().toDOMElement(source); XMLStreamWriter xmlWriter = message .getContent(XMLStreamWriter.class);