Package org.apache.axiom.om.impl

Examples of org.apache.axiom.om.impl.OMNamespaceImpl


     * @return Returns namespace.
     */
    public OMNamespace declareNamespace(String uri, String prefix) {
        if ("".equals(prefix))
            prefix = OMSerializerUtil.getNextNSPrefix();
        OMNamespaceImpl ns = new OMNamespaceImpl(uri, prefix);
        return declareNamespace(ns);
    }
View Full Code Here


     *
     * @param uri
     */
    public OMNamespace declareDefaultNamespace(String uri) {

        OMNamespaceImpl namespace = new OMNamespaceImpl(uri == null ? "" : uri, "");

        if (namespaces == null) {
            this.namespaces = new HashMap(5);
        }
        namespaces.put("", namespace);
View Full Code Here

            this.namespaces = new HashMap(5);
        }
        String prefix = namespace.getPrefix();
        if (prefix == null) {
            prefix = OMSerializerUtil.getNextNSPrefix();
            namespace = new OMNamespaceImpl(namespace.getNamespaceURI(), prefix);
        }
        namespaces.put(prefix, namespace);
        return namespace;
    }
View Full Code Here

        if (ns != null) {
            String namespaceURI = ns.getNamespaceURI();
            String prefix = ns.getPrefix();
            namespace = findNamespace(namespaceURI, prefix);
            if (namespace == null) {
                namespace = new OMNamespaceImpl(namespaceURI, prefix);
            }
        }
        return addAttribute(new OMAttributeImpl(attributeName, namespace, value, this.factory));
    }
View Full Code Here

    private OMElement serialize(String config) throws XMLStreamException {
        PaypalMediator mediator = PaypalTestUtil.buildMediator("compact", PaypalTestUtil.
                getConfiguration(config));
        PaypalCompactSerializer serializer = new PaypalCompactSerializer(OMAbstractFactory.getOMFactory(),
                                                                         XMLConfigConstants.SYNAPSE_OMNAMESPACE,
                                                                         new OMNamespaceImpl(XMLConfigConstants.NULL_NAMESPACE, "nns"));
        OMElement serializedElement = serializer.serializeMediator(null, mediator);
        return serializedElement;
    }
View Full Code Here

    //returns the OMSourcedElementImpl with JSONDataSource inside

    public OMElement processDocument(InputStream inputStream, String contentType, MessageContext messageContext) throws AxisFault {
        String localName = "";
        String prefix = "";
        OMNamespace ns = new OMNamespaceImpl("", "");

        OMFactory factory = OMAbstractFactory.getOMFactory();

        //if the input stream is null, then check whether the HTTP method is GET, if so get the JSON String which is received as a parameter, and make it an
        //input stream
View Full Code Here

                || org.apache.axiom.soap.SOAPConstants.HEADER_LOCAL_NAME.equals(localName)
                || org.apache.axiom.soap.SOAPConstants.SOAPENVELOPE_LOCAL_NAME .equals(localName)) {
            throw new SOAPException("changing this element name is not allowed");
        }
        OMNamespace omNamespace =
                new OMNamespaceImpl(newName.getNamespaceURI(), newName.getPrefix());
        this.element.setNamespace(omNamespace);
        this.element.setLocalName(newName.getLocalPart());
        return this;
    }
View Full Code Here

       
        // Need to add a SOAP Header to stop this error from XMLComparator:
        // "There is no Header element under Envelope"
        SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        SOAPHeaderBlock soapHeaderBlock = envelope.getHeader().addHeaderBlock(
                "testHeader", new OMNamespaceImpl("http://test.com", "test"));
        msgCtxt.setEnvelope(envelope);
       
        outHandler.invoke(msgCtxt);

        XMLUnit.setIgnoreWhitespace(true);
View Full Code Here

       
        // Need to add a SOAP Header to stop this error from XMLComparator:
        // "There is no Header element under Envelope"
        SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
        SOAPHeaderBlock soapHeaderBlock = envelope.getHeader().addHeaderBlock(
                "testHeader", new OMNamespaceImpl("http://test.com", "test"));
        msgCtxt.setEnvelope(envelope);
       
        outHandler.invoke(msgCtxt);

        XMLUnit.setIgnoreWhitespace(true);
View Full Code Here

                || org.apache.axiom.soap.SOAPConstants.HEADER_LOCAL_NAME.equals(localName)
                || org.apache.axiom.soap.SOAPConstants.SOAPENVELOPE_LOCAL_NAME .equals(localName)) {
            throw new SOAPException("changing this element name is not allowed");
        }
        OMNamespace omNamespace =
                new OMNamespaceImpl(newName.getNamespaceURI(), newName.getPrefix());
        this.element.setNamespace(omNamespace);
        this.element.setLocalName(newName.getLocalPart());
        return this;
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.impl.OMNamespaceImpl

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.