public static OMElement extractElement(XMLStreamReader reader, boolean proceedToNext) { OMDocument document = OMXMLBuilderFactory.createStAXOMBuilder( new XMLFragmentStreamReader(reader, proceedToNext)).getDocument(); document.build(); return document.getOMDocumentElement(); } }
public AxisMessage(MessageContext msgContext) throws Exception { envelope = msgContext.getEnvelope(); // If possible, build the parent (i.e. the OMDocument) to make sure that the entire message is read. // If the transport doesn't handle the end of the message properly, then this problem // will show up here. OMDocument document = (OMDocument)envelope.getParent(); if (document != null) { document.build(); } else { envelope.build(); } // TODO: quick & dirty hack to force expansion of OMSourceElement payloads OMElement content = envelope.getBody().getFirstElement(); if (content instanceof OMSourcedElement) { ((OMSourcedElement)content).getFirstOMChild(); ((OMSourcedElement)content).build(); } if (msgContext.isDoingSwA()) { // Make sure that all attachments are read attachments = msgContext.getAttachmentMap(); attachments.getAllContentIDs(); } messageType = (String)msgContext.getProperty(Constants.Configuration.MESSAGE_TYPE); }
public AxisMessage(MessageContext msgContext) throws Exception { envelope = msgContext.getEnvelope(); // If possible, build the parent (i.e. the OMDocument) to make sure that the entire message is read. // If the transport doesn't handle the end of the message properly, then this problem // will show up here. OMDocument document = (OMDocument)envelope.getParent(); if (document != null) { document.build(); } else { envelope.build(); } // TODO: quick & dirty hack to force expansion of OMSourceElement payloads OMElement content = envelope.getBody().getFirstElement(); if (content instanceof OMSourcedElement) { ((OMSourcedElement)content).getFirstOMChild(); ((OMSourcedElement)content).build(); } if (msgContext.isDoingSwA()) { // Make sure that all attachments are read attachments = msgContext.getAttachmentMap(); attachments.getAllContentIDs(); } messageType = (String)msgContext.getProperty(Constants.Configuration.MESSAGE_TYPE); }
public AxisMessage(MessageContext msgContext) throws Exception { envelope = msgContext.getEnvelope(); // If possible, build the parent (i.e. the OMDocument) to make sure that the entire message is read. // If the transport doesn't handle the end of the message properly, then this problem // will show up here. OMDocument document = (OMDocument)envelope.getParent(); if (document != null) { document.build(); } else { envelope.build(); } // TODO: quick & dirty hack to force expansion of OMSourceElement payloads OMElement content = envelope.getBody().getFirstElement(); if (content instanceof OMSourcedElement) { ((OMSourcedElement)content).getFirstOMChild(); ((OMSourcedElement)content).build(); } if (msgContext.isDoingSwA()) { // Make sure that all attachments are read attachments = msgContext.getAttachmentMap(); attachments.getAllContentIDs(); } messageType = (String)msgContext.getProperty(Constants.Configuration.MESSAGE_TYPE); }