Package org.apache.axis2.om

Examples of org.apache.axis2.om.OMNamespace


        propertyList.add(dummyBean);

        ArrayList attributes = new ArrayList();
        OMFactory factory = OMAbstractFactory.getOMFactory();
        QName elementQName = new QName("http://ec.org/software", "Employee", "emp");
        OMNamespace attrNS = factory.createOMNamespace("mailto:whoever@whatever.com", "attrNS");

        // add some attributes with namespaces
        OMAttribute[] attribute = new OMAttribute[5];
        for (int i = 0; i < 5; i++) {
            attribute[i] = factory.createOMAttribute("Attr" + (i + 1), attrNS, "Value " + (i + 1));
View Full Code Here


    </axis2:Module>
</apache:Project>

        */
        final OMFactory fac = OMAbstractFactory.getOMFactory();
        final OMNamespace axis2NS = fac.createOMNamespace("http://ws.apache.org/namespaces/axis2", "axis2");


        class Dependencies implements ADBBean {

            String[] dependencies;
View Full Code Here

     */
    public static void serializeAttribute(OMAttribute attr, OMOutputImpl omOutput)
            throws XMLStreamException {

        // first check whether the attribute is associated with a namespace
        OMNamespace ns = attr.getNamespace();
        String prefix = null;
        String namespaceName = null;
        XMLStreamWriter writer = omOutput.getXmlStreamWriter();
        if (ns != null) {

            // add the prefix if it's availble
            prefix = ns.getPrefix();
            namespaceName = ns.getName();
            if (prefix != null) {
                writer.writeAttribute(prefix, namespaceName,
                        attr.getLocalName(), attr.getAttributeValue());
            } else {
                writer.writeAttribute(namespaceName, attr.getLocalName(),
View Full Code Here

                    fac = OMAbstractFactory.getSOAP11Factory();
                }else{
                    fac = OMAbstractFactory.getSOAP12Factory();
                }
                SOAPEnvelope envelope = fac.getDefaultEnvelope();
                OMNamespace ns =
                    fac.createOMNamespace("http://soapenc/", "res");
                OMElement responseElement =
                    fac.createOMElement(methodName + "Response", ns);
                String outMessageString = obj.toString();
                // System.out.println("outMessageString = " + outMessageString);
View Full Code Here

                OMAttribute attr = (OMAttribute) iter.next();
                declaredNS.add(attr.getNamespace());
            }
            for (Iterator iter = declaredNS.iterator();
                 iter != null && iter.hasNext();) {
                OMNamespace namespace = (OMNamespace) iter.next();
                if (namespace != null) {
                    String prefix = namespace.getPrefix();
                    if (prefix != null && !prefixes.contains(prefix)) {
                        prefixes.add(prefix);
                        nsList.add(new OMNamespaceEx(namespace, context));
                    }
                }
View Full Code Here

     * method getMessageContext
     *
     * @return msgContext
     */
    public static MessageContext getMessageContext() throws AxisFault {
        OMNamespace namespace, nulNS;
        OMElement operation, value1, value2;
        OMElement subValue1, subValue2, subValue3, subValue4, subValue5;

        SOAPFactory omFactory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope reqEnv = omFactory.getDefaultEnvelope();
View Full Code Here

    public QName resolveQName(String qname, boolean defaultToParentNameSpace) {
        int colon = qname.indexOf(':');
        if (colon < 0) {
            if (defaultToParentNameSpace) {
                //get the parent ns and use it for the child
                OMNamespace namespace = element.getNamespace();
                return new QName(namespace.getName(), qname, namespace.getPrefix());
            } else {
                //else things without no prefix are local.
                return new QName(qname);
            }
        }
        String prefix = qname.substring(0, colon);
        String local = qname.substring(colon + 1);
        if (local.length() == 0) {
            //empy local, exit accordingly
            return null;
        }

        OMNamespace namespace = element.findNamespaceURI(prefix);
        if (namespace == null) {
            return null;
        }
        return new QName(namespace.getName(), local, prefix);
    }
View Full Code Here

    /**
     * Method handleNamespace.
     */
    private OMNamespace handleNamespace(QName qname) {
        OMNamespace ns = null;

        // first try to find a namespace from the scope
        String namespaceURI = qname.getNamespaceURI();
        if (namespaceURI != null && namespaceURI.length() > 0) {
            ns = findNamespace(qname.getNamespaceURI(),
View Full Code Here

     * Method handleNamespace.
     *
     * @return Returns namespace.
     */
    private OMNamespace handleNamespace(OMNamespace ns) {
        OMNamespace namespace = findNamespace(ns.getName(),
                ns.getPrefix());
        if (namespace == null) {
            namespace = declareNamespace(ns);
        }
        return namespace;
View Full Code Here

     * If none is found, returns null.
     */
    public OMNamespace findNamespace(String uri, String prefix) {

        // check in the current element
        OMNamespace namespace = findDeclaredNamespace(uri, prefix);
        if (namespace != null) {
            return namespace;
        }

        // go up to check with ancestors
View Full Code Here

TOP

Related Classes of org.apache.axis2.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.