elem.build();
if (elem instanceof SOAPEnvelope) {
SOAPEnvelope soapEnvelope = (SOAPEnvelope) elem;
String soapNamespace = soapEnvelope.getNamespace().getNamespaceURI();
if (soapEnvelope.getHeader() == null) {
SOAPFactory soapFactory;
if (soapNamespace.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
soapFactory = OMAbstractFactory.getSOAP12Factory();
} else {
soapFactory = OMAbstractFactory.getSOAP11Factory();
}
soapFactory.createSOAPHeader(soapEnvelope);
}
sourceNodeList.add(soapEnvelope);
} else {
sourceNodeList.add(elem);
}
} catch (XMLStreamException e) {
synLog.error("Source Property cannot be parsed : " + e.getStackTrace().toString());
}
} else if (o instanceof ArrayList) {
ArrayList nodesList = (ArrayList) o;
for (Object node : nodesList) {
if (node instanceof OMElement) {
if (node instanceof SOAPEnvelope) {
SOAPEnvelope soapEnvelope = (SOAPEnvelope) node;
String soapNamespace = null;
if (soapEnvelope.getNamespace() != null) {
soapNamespace = soapEnvelope.getNamespace().getNamespaceURI();
}
if (soapEnvelope.getHeader() == null && soapNamespace != null) {
SOAPFactory soapFactory;
if (soapNamespace.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
soapFactory = OMAbstractFactory.getSOAP12Factory();
} else {
soapFactory = OMAbstractFactory.getSOAP11Factory();
}
soapFactory.createSOAPHeader(soapEnvelope);
}
sourceNodeList.add(soapEnvelope);
} else {
OMElement ele = (OMElement) node;
sourceNodeList.add(ele);