Examples of OMFactory


Examples of org.apache.axiom.om.OMFactory

    public void serialize(SynapseConfiguration synapseConfig) {
        if (log.isDebugEnabled()) {
            log.debug("Serializing Synapse configuration to the file system");
        }

        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMElement definitions = fac.createOMElement("definitions",
                XMLConfigConstants.SYNAPSE_OMNAMESPACE);

        boolean errorOccurred = false;

        try {
View Full Code Here

Examples of org.apache.axiom.om.OMFactory

     *
     * @param synapseConfig Current Synapse configuration
     * @throws Exception on file I/O error
     */
    public void serializeSynapseXML(SynapseConfiguration synapseConfig) throws Exception {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMElement definitions = fac.createOMElement("definitions",
                XMLConfigConstants.SYNAPSE_OMNAMESPACE);

        if (synapseConfig.getRegistry() != null && !Boolean.valueOf(synapseConfig.getProperty(
                MultiXMLConfigurationBuilder.SEPARATE_REGISTRY_DEFINITION))) {
            RegistrySerializer.serializeRegistry(definitions, synapseConfig.getRegistry());
View Full Code Here

Examples of org.apache.axiom.om.OMFactory

    }
    return getBinaryPayload(mc.getEnvelope());
  }

  public static void setBinaryPayload(SOAPEnvelope envelope, DataHandler dh) {
    OMFactory fac = envelope.getOMFactory();
    OMElement binaryElt = envelope.getOMFactory()
        .createOMElement(BINARYELT);
    OMText text = fac.createOMText(dh, true);
    binaryElt.addChild(text);
    setXMLPayload(envelope, binaryElt);
  }
View Full Code Here

Examples of org.apache.axiom.om.OMFactory

    }
    return getTextPayload(mc.getEnvelope());
  }

  public static void setTextPayload(SOAPEnvelope envelope, String text) {
    OMFactory fac = envelope.getOMFactory();
    OMElement textElt = envelope.getOMFactory().createOMElement(TEXTELT);
    OMText textNode = fac.createOMText(text);
    textElt.addChild(textNode);
    setXMLPayload(envelope, textElt);
  }
View Full Code Here

Examples of org.apache.axiom.om.OMFactory

                            sourceNodeList.add((OMElement) o);
                        }
                    } else if (o instanceof OMText) {
                        sourceNodeList.add((OMText) o);
                    } else if (o instanceof String) {
      OMFactory fac = OMAbstractFactory.getOMFactory();
      sourceNodeList.add(fac.createOMText(o.toString()))
                    }
                }
            } else {
                synLog.error("Specified node by xpath cannot be found.");
            }
View Full Code Here

Examples of org.apache.axiom.om.OMFactory

               
                SOAPBody body = envelope.getBody();
                OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(parser);
                OMElement bodyElement = builder.getDocumentElement();
                if (addTextAroundBody) {
                    OMFactory fac = OMAbstractFactory.getOMFactory();
                    body.addChild(fac.createOMText("\n"));
                    body.addChild(bodyElement);
                    body.addChild(fac.createOMText("\n"));
                } else {
                    body.addChild(bodyElement);
                }
            }
        } else {
View Full Code Here

Examples of org.apache.axiom.om.OMFactory

                    definition,
                    NAME,
                    operationName);
            if (operationSchema != null)
            {
                final OMFactory factory = OMAbstractFactory.getOMFactory();

                // - collect all the namespaces
                final Map<String, OMNamespace> namespaces = new HashMap<String, OMNamespace>();
                final OMNamespace xsiNamespace = factory.createOMNamespace(XSI_NS, XSI_PREFIX);
                namespaces.put(XSI_PREFIX, xsiNamespace);

                final Collection<Schema> schemas = getSchemas(definition);
                for (final Schema schema : schemas)
                {
                    final String namespace = Axis2ClientUtils.getTargetNamespace(schema);
                    final String prefix = getNamespacePrefix(
                            definition,
                            namespace);
                    namespaces.put(prefix, factory.createOMNamespace(namespace, prefix));
                }

                operationOMElement =
                    getOMElement(
                        definition,
View Full Code Here

Examples of org.apache.axiom.om.OMFactory

        }
        catch (IOException ex) {
            throw new AxisFault("I/O error", ex);
        }
       
        OMFactory factory = new OMLinkedListImplFactory();
        OMElement message = factory.createOMElement(SyslogConstants.MESSAGE);
        message.addAttribute(factory.createOMAttribute(SyslogConstants.FACILITY, null, facility));
        message.addAttribute(factory.createOMAttribute(SyslogConstants.SEVERITY, null, severity));
        if (tag != null) {
            message.addAttribute(factory.createOMAttribute(SyslogConstants.TAG, null, tag));
        }
        if (pid != -1) {
            message.addAttribute(factory.createOMAttribute(SyslogConstants.PID, null, String.valueOf(pid)));
        }
        message.setText(content);
       
        return message;
    }
View Full Code Here

Examples of org.apache.axiom.om.OMFactory

               
                SOAPBody body = envelope.getBody();
                StAXOMBuilder builder = new StAXOMBuilder(parser);
                OMElement bodyElement = builder.getDocumentElement();
                if (addTextAroundBody) {
                    OMFactory fac = OMAbstractFactory.getOMFactory();
                    body.addChild(fac.createOMText("\n"));
                    body.addChild(bodyElement);
                    body.addChild(fac.createOMText("\n"));
                } else {
                    body.addChild(bodyElement);
                }
            }
        } else {
View Full Code Here

Examples of org.apache.axiom.om.OMFactory


    }

    private static OMElement commodityPayload() {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace businessNS =
                fac.createOMNamespace("http://business.org", "ns");
        OMNamespace emptyNS = fac.createOMNamespace("", "");
        OMElement commodityEle = fac.createOMElement("commodity", businessNS);

        OMElement realCommodity = fac.createOMElement("commodity", emptyNS);
        realCommodity.setText("W");

        commodityEle.addChild(realCommodity);

        return commodityEle;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.