private static OMElement buildResponse(OMElement omElement) { omElement.build(); return omElement; } }
/** * Creates OMElement for a given description document (axis2.xml , * services.xml and module.xml). * * @return Returns <code>OMElement</code> . * @throws javax.xml.stream.XMLStreamException * */ public OMElement buildOM() throws XMLStreamException { OMElement element = (OMElement) XMLUtils.toOM(descriptionStream); element.build(); return element; }
/** * Creates OMElement for a given description document (axis2.xml , * services.xml and module.xml). * * @return Returns <code>OMElement</code> . * @throws javax.xml.stream.XMLStreamException * */ public OMElement buildOM() throws XMLStreamException { OMElement element = (OMElement) XMLUtils.toOM(descriptionStream); element.build(); return element; }
public static OMElement buildOMElement(String payload) throws RegistryException { OMElement element; try { element = AXIOMUtil.stringToOM(payload); element.build(); } catch (Exception e) { String message = "Unable to parse the XML configuration. Please validate the XML configuration"; log.error(message,e); throw new RegistryException(message,e); } return element; }
public static OMElement getServiceOMElement(Resource newResource) { try { String content = getResourceContent(newResource); XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader( new StringReader(content)); StAXOMBuilder builder = new StAXOMBuilder(reader); OMElement serviceElement = builder.getDocumentElement(); serviceElement.build(); return serviceElement; } catch (Exception e) { log.error("Error in parsing the resource content"); } return null; }
/** * Converts the DOM representation of an Element to the Axiom one. * * @param element The DOM representation of the element * @return The Axiom representation of the same element */ public static OMElement convertDOMElementToAxiom(final Element element) { OMXMLParserWrapper parser = OMXMLBuilderFactory.createOMBuilder(element, false); OMElement omElement = parser.getDocumentElement(); omElement.build(); return omElement; } }
private void loadRecord( File recordFile ) throws IOException { FileInputStream recordStream = new FileInputStream( recordFile ); OMElement document = new XMLAdapter( recordStream ).getRootElement(); document.build(); MetadataRecord record = MetadataRecordFactory.create( document ); recordStream.close(); if ( !( record instanceof ISORecord ) ) { LOG.debug( "Ignore record {}: is not a ISO19139 record.", recordFile.getName() ); return; } addOrUpdateRecord( (ISORecord) record, recordFile ); }
/** * Convert servicexmlStream to OMElement * * @param servicexmlStream InputStream contain xml content * @return OMElement format of the xml content * @throws XMLStreamException */ public static OMElement convertToOMElement(InputStream servicexmlStream) throws XMLStreamException, OMException{ OMElement element = null; element = OMXMLBuilderFactory.createOMBuilder(servicexmlStream).getDocumentElement(); element.build(); return element; }
/** * Convert servicexmlStream to OMElement * * @param servicexmlStream InputStream contain xml content * @return OMElement format of the xml content * @throws XMLStreamException */ public static OMElement convertToOMElement(InputStream servicexmlStream) throws XMLStreamException, OMException{ OMElement element = null; element = OMXMLBuilderFactory.createOMBuilder(servicexmlStream).getDocumentElement(); element.build(); return element; }
public XmlConfiguration(InputStream xmlFile, String serverNamespace) throws CarbonException { if (serverNamespace != null) { this.serverNamespace = serverNamespace; } try { builder = new StAXOMBuilder(xmlFile); builder.getDocumentElement().build(); } catch (Exception e) { String msg = "Error occurred while trying to instantiate StAXOMBuilder for XML file " + xmlFile; log.error(msg, e); throw new CarbonException(msg, e); } }
public XmlConfiguration(String xmlFile, String serverNamespace) throws CarbonException { if (serverNamespace != null) { this.serverNamespace = serverNamespace; } try { builder = new StAXOMBuilder(xmlFile); builder.getDocumentElement().build(); } catch (Exception e) { String msg = "Error occurred while trying to instantiate StAXOMBuilder for XML file " + xmlFile; log.error(msg, e); throw new CarbonException(msg, e); } }
public XmlConfiguration(String xmlFile, String serverNamespace) throws CarbonException { if (serverNamespace != null) { this.serverNamespace = serverNamespace; } try { builder = new StAXOMBuilder(xmlFile); builder.getDocumentElement().build(); } catch (Exception e) { String msg = "Error occurred while trying to instantiate StAXOMBuilder for XML file " + xmlFile; log.error(msg, e); throw new CarbonException(msg, e); } }
public XmlConfiguration(InputStream xmlFile, String serverNamespace) throws CarbonException { if (serverNamespace != null) { this.serverNamespace = serverNamespace; } try { builder = new StAXOMBuilder(xmlFile); builder.getDocumentElement().build(); } catch (Exception e) { String msg = "Error occurred while trying to instantiate StAXOMBuilder for XML file " + xmlFile; log.error(msg, e); throw new CarbonException(msg, e); } }
public XmlConfiguration(InputStream xmlFile, String serverNamespace) throws CarbonException { if (serverNamespace != null) { this.serverNamespace = serverNamespace; } try { builder = new StAXOMBuilder(xmlFile); builder.getDocumentElement().build(); } catch (Exception e) { String msg = "Error occurred while trying to instantiate StAXOMBuilder for XML file " + xmlFile; log.error(msg, e); throw new CarbonException(msg, e); } }
/** * This will build a DOOM Element that is of the same <code>Document</code> * @param factory * @param element * @return */ public static OMElement toDOOM(OMFactory factory, OMElement element){ StAXOMBuilder builder = new StAXOMBuilder(factory, element.getXMLStreamReader()); OMElement elem = builder.getDocumentElement(); elem.build(); return elem; }
public static SynapseConfiguration getConfiguration(InputStream is, Properties properties) throws XMLStreamException { log.info("Generating the Synapse configuration model by parsing the XML configuration"); OMElement definitions = OMXMLBuilderFactory.createOMBuilder(is).getDocumentElement(); definitions.build(); return ConfigurationFactoryAndSerializerFinder.getInstance() .getConfiguration(definitions, properties); } }
/** * Creates a new OMElement from the given element and build it and return. * * @param result The object to be cloned and built * @return The new cloned and built OMElement */ public static OMElement cloneAndReturnBuiltElement(OMElement result) { StAXOMBuilder builder = new StAXOMBuilder(result.getXMLStreamReaderWithoutCaching()); result = builder.getDocumentElement(); result.build(); return result; }
public static SynapseConfiguration getConfiguration(InputStream is, Properties properties) throws XMLStreamException { log.info("Generating the Synapse configuration model by parsing the XML configuration"); OMElement definitions = new StAXOMBuilder(is).getDocumentElement(); definitions.build(); return ConfigurationFactoryAndSerializerFinder.getInstance() .getConfiguration(definitions, properties); } }
/** * Gets an llom element and returns a doom element * * @param body * @return OMElement */ public static DOOMElementMetadata getDOOMElement(OMElement body) { body.build(); XMLStreamReader xmlStreamReader = body.getXMLStreamReader(); OMFactory fac = DOOMAbstractFactory.getOMFactory(); StAXOMBuilder builder = new StAXOMBuilder(fac, xmlStreamReader); return new DOOMElementMetadata(builder.getDocumentElement(), (OMDOMFactory) fac); }
public Iterator<OMElement> execute() throws AxisFault { OMElement message = createMessageEl(this.msgBoxId); ServiceClient serviceClient = createServiceClient(message); OMElement responseMessage = null; try { responseMessage = serviceClient.sendReceive(message); if (responseMessage == null) { throw AxisFault.makeFault(new RuntimeException("no response recieved for subscription message")); } responseMessage.build(); // free the input stream. } finally { serviceClient.cleanupTransport(); } return (Iterator<OMElement>) responseMessage.getFirstElement().getChildren(); }