Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMNode


        SynapseBinaryDataSource synapseBinaryDataSource = null;
        Iterator it = omElement.getChildren();

        while (it.hasNext() && synapseBinaryDataSource == null) {

            OMNode hessianElement = (OMNode) it.next();
            if (hessianElement instanceof OMText) {

                OMText tempNode = (OMText) hessianElement;
                if (tempNode.getDataHandler() != null
                        && ((DataHandler) tempNode.getDataHandler()).getDataSource() instanceof SynapseBinaryDataSource) {
View Full Code Here


     * @param properties bag of properties with additional information
     * @return the matching resultant object
     */
    public Object getResource(Entry entry, Properties properties) {

        OMNode omNode = null;
        RegistryEntry re = null;

        // we are dealing with a dynamic resource. Have we seen this before and processed
        // it at least once and have it cached already?

View Full Code Here

            if (log.isDebugEnabled()) {
                log.debug("Only the registry is defined in the synapse configuration, trying " +
                        "to fetch a configuration from the registry");
            }
            // TODO: support a artifact repo for registry as well instead of just the synapse.xml
            OMNode remoteConfigNode = localConfigReg.lookup("synapse.xml");
            if (remoteConfigNode != null) {
                try {
                    synCfg = XMLConfigurationBuilder.getConfiguration(SynapseConfigUtils
                            .getStreamSource(remoteConfigNode).getInputStream(), properties);
                    // TODO: when you fetch the configuration and serialize the config in any case
View Full Code Here

            if (wsdlURI != null) {

                wsdlEndpoint.setWsdlURI(wsdlURI.trim());
                try {
                    OMNode wsdlOM = SynapseConfigUtils.getOMElementFromURL(new URL(wsdlURI)
                            .toString(), properties.get(SynapseConstants.SYNAPSE_HOME) != null ?
                            properties.get(SynapseConstants.SYNAPSE_HOME).toString() : "");
                    if (wsdlOM != null && wsdlOM instanceof OMElement) {
                        OMElement omElement = (OMElement) wsdlOM;
                        OMNamespace ns = omElement.getNamespace();
View Full Code Here

      } else {
        envelope.addChild(body);
      }
    } else {
      for (Iterator it = body.getChildren(); it.hasNext();) {
        OMNode node = (OMNode) it.next();
        node.discard();
      }
    }
    body.addChild(element);
  }
View Full Code Here

      return null;
    if (!el.getQName().equals(BINARYELT)) {
      log.error("Wrong QName" + el.getQName());
      return null;
    }
    OMNode textNode = el.getFirstOMChild();
    if (textNode.getType() != OMNode.TEXT_NODE) {
      log.error("Text Node not found");
      return null;
    }
    OMText text = (OMText) textNode;
        try {
View Full Code Here

      return null;
    if (!el.getQName().equals(TEXTELT)) {
      log.error("Wrong QName " + el.getQName());
      return null;
    }
    OMNode textNode = el.getFirstOMChild();
    if (textNode.getType() != OMNode.TEXT_NODE) {
      log.error("Text Node not found");
      return null;
    }
    OMText text = (OMText) textNode;
    return text.getText();
View Full Code Here

    private final SourceXPathSupport target = new SourceXPathSupport();
    private String property;

    public boolean mediate(MessageContext synCtx) {
        SynapseLog synLog = getLog(synCtx);
        OMNode replacement = (OMNode)synCtx.getProperty(property);
        OMNode node = target.selectOMNode(synCtx, synLog);
        node.insertSiblingAfter(replacement);
        node.detach();
        synCtx.setProperty(property, null);
        return true;
    }
View Full Code Here

    private final SourceXPathSupport source = new SourceXPathSupport();
    private String property;

    public boolean mediate(MessageContext synCtx) {
        SynapseLog synLog = getLog(synCtx);
        OMNode node = source.selectOMNode(synCtx, synLog);
        node.detach();
        synCtx.setProperty(property, node);
        return true;
    }
View Full Code Here

            throws IOException {

        HessianTestHelper hessianTestHelper = new HessianTestHelper();
        MessageContext msgContext = hessianTestHelper.createAxis2MessageContext(synEnv);
        OMElement element = hessianTestHelper.buildHessianTestMessage(testMessageName, msgContext);
        OMNode hessianNode = element.getFirstOMChild();
        OMText hessianTextNode = (OMText) hessianNode;
        SynapseBinaryDataSource synapseBinaryDataSource = (SynapseBinaryDataSource)
            ((DataHandler) hessianTextNode.getDataHandler()).getDataSource();
        InputStream inputStream = synapseBinaryDataSource.getInputStream();
        byte[] originalByteArray = IOUtils.toByteArray(getClass().getResourceAsStream(
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.OMNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.