Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMNamespace


      QName qname,
      OMContainer parent,
      OMFactory factory,
      Object objecttype) {
      OMElement element = null;
      OMNamespace namespace =
        this.createOMNamespace(
          qname.getNamespaceURI(),
          qname.getPrefix());
      if (FEED.equals(qname)) {
        element = new FOMFeed(qname.getLocalPart(), namespace, parent, factory);
View Full Code Here


            }
        }

        OMElement code = fac.createOMElement("code", synNS, fault);
        if (mediator.getFaultCodeValue() != null) {
            OMNamespace ns = code.declareNamespace(mediator.getFaultCodeValue().getNamespaceURI(),
                    mediator.getFaultCodeValue().getPrefix());
            code.addAttribute(fac.createOMAttribute(
                    "value", nullNS, ns.getPrefix() + ":"
                    + mediator.getFaultCodeValue().getLocalPart()));

        } else if (mediator.getFaultCodeExpr() != null) {
            SynapseXPathSerializer.serializeXPath(mediator.getFaultCodeExpr(), code, "expression");
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("Serializing Synapse configuration to the file system");
        }

        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace synNS = fac.createOMNamespace(XMLConfigConstants.SYNAPSE_NAMESPACE, "syn");
        OMElement definitions = fac.createOMElement("definitions", synNS);

        try {
            currentDirectory = createTempDirectoryStructure();
View Full Code Here

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

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

public class EventSourceSerializer {

    public static OMElement serializeEventSource(OMElement elem, SynapseEventSource eventSource) {

        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace nullNS = fac.createOMNamespace(XMLConfigConstants.NULL_NAMESPACE, "");

        OMElement evenSourceElem =
                fac.createOMElement("eventSource", XMLConfigConstants.SYNAPSE_OMNAMESPACE);
        if (eventSource.getName() != null) {
            evenSourceElem
View Full Code Here

                SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) o;
                headerBlock.detach();
            } else if (o instanceof OMElement) {
                // work around for a known addressing bug which sends non SOAPHeaderBlock objects
                OMElement om = (OMElement) o;
                OMNamespace ns = om.getNamespace();
                if (ns != null && (
                    AddressingConstants.Submission.WSA_NAMESPACE.equals(ns.getNamespaceURI()) ||
                        AddressingConstants.Final.WSA_NAMESPACE.equals(ns.getNamespaceURI()))) {
                    om.detach();
                }
            }
        }
    }
View Full Code Here

     * Return true if the SOAP header is an addressing header
     * @param headerBlock SOAP header block to be checked
     * @return true if the SOAP header is an addressing header
     */
    private static boolean isAddressingHeader(SOAPHeaderBlock headerBlock) {
        OMNamespace ns = headerBlock.getNamespace();
        return ns != null && (
                AddressingConstants.Submission.WSA_NAMESPACE.equals(ns.getNamespaceURI()) ||
                        AddressingConstants.Final.WSA_NAMESPACE.equals(ns.getNamespaceURI()));
    }
View Full Code Here

    }
   
    protected void runTest() throws Throwable {
        OMFactory fac = metaFactory.getOMFactory();

        OMNamespace nsParent = createNamespace(fac, parent);
        OMNamespace nsChildren = createNamespace(fac, children);

        OMElement personElem = fac.createOMElement("person", nsParent);
        OMElement nameElem = fac.createOMElement("name", nsChildren);
        nameElem.setText("John");
View Full Code Here

    /*
     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception {
        OMNamespace testingNamespace = factory.createOMNamespace(
                "http://testing.ws.org", "ws");
        firstElement = factory.createOMElement("FirstElement", testingNamespace);
        secondElement = factory.createOMElement("SecondElement", factory.createOMNamespace(
                "http://moretesting.ws.org", "ws"), firstElement);
    }
View Full Code Here

                " the same namespace object",
                   firstElement.getNamespace() != secondElement.getNamespace());
        assertEquals("OMElement children addition has not worked properly", secondElement,
                     firstElement.getFirstElement());

        OMNamespace testNamespace2 = factory.createOMNamespace("ftp://anotherTest.ws.org", "ws");
        firstElement.declareNamespace(testNamespace2);

        OMNamespace inheritedSecondNamespace =
                secondElement.findNamespace(testNamespace2.getNamespaceURI(),
                                            testNamespace2.getPrefix());
        assertNotNull("Children should inherit namespaces declared in parent",
                      inheritedSecondNamespace);
        assertEquals("inherited namespace uri should be equal",
                     inheritedSecondNamespace.getNamespaceURI(), testNamespace2.getNamespaceURI());
        assertEquals("inherited namespace prefix should be equal",
                     inheritedSecondNamespace.getPrefix(), testNamespace2.getPrefix());


    }
View Full Code Here

TOP

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

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.