Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMNamespace


            proxyService.addOperation(mediateOperation);
        }

        // if a WSDL was found
        if (wsdlElement != null) {
            OMNamespace wsdlNamespace = wsdlElement.getNamespace();

            // serialize and create an inputstream to read WSDL
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            try {
                if (trace()) trace.info("Serializing wsdlElement found to build an Axis2 service");
                wsdlElement.serialize(baos);
                wsdlInputStream = new ByteArrayInputStream(baos.toByteArray());
            } catch (XMLStreamException e) {
                handleException("Error converting to a StreamSource", e);
            }

            if (wsdlInputStream != null) {

                try {
                    // detect version of the WSDL 1.1 or 2.0
                    if (trace()) trace.info("WSDL Namespace is : "
                        + wsdlNamespace.getNamespaceURI());

                    if (wsdlNamespace != null) {
                        WSDLToAxisServiceBuilder wsdlToAxisServiceBuilder = null;

                        if (WSDL2Constants.WSDL_NAMESPACE.
                                equals(wsdlNamespace.getNamespaceURI())) {
                            wsdlToAxisServiceBuilder =
                                    new WSDL20ToAxisServiceBuilder(wsdlInputStream, null, null);

                        } else if (org.apache.axis2.namespace.Constants.NS_URI_WSDL11.
                                equals(wsdlNamespace.getNamespaceURI())) {
                            wsdlToAxisServiceBuilder =
                                    new WSDL11ToAxisServiceBuilder(wsdlInputStream);
                        } else {
                            handleException("Unknown WSDL format.. not WSDL 1.1 or WSDL 2.0");
                        }
View Full Code Here


        } else {
            serviceClient = new ServiceClient();
        }
        OMFactory factory = OMAbstractFactory.getOMFactory();

        OMNamespace nsaip = factory.createOMNamespace(topicns, "aip");

        // set the target topic
        OMElement topicOm = factory.createOMElement("Topic", nsaip);
        factory.createOMText(topicOm, topic);
View Full Code Here

public class PriorityExecutorSerializer {

    public static OMElement serialize(OMElement parent,
                                      PriorityExecutor executor, String namespace) {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace nullNS = fac.createOMNamespace("", "");

        OMElement executorElement = createElement(ExecutorConstants.PRIORITY_EXECUTOR, namespace);
        if (executor.getName() != null) {
            executorElement.addAttribute(fac.createOMAttribute(ExecutorConstants.NAME,
                    nullNS, executor.getName()));
View Full Code Here

        OMFactory fac = OMAbstractFactory.getOMFactory();
        if (namespace == null) {
            return fac.createOMElement(new QName(name));
        }

        OMNamespace omNamespace = fac.createOMNamespace(namespace, "");
        return fac.createOMElement(name, omNamespace);
    }
View Full Code Here

        EndpointReference subscriptionManagerEPR =
                new EndpointReference(subscription.getSubManUrl());
        subscriptionManagerEPR.addReferenceParameter(new QName(EventingConstants.WSE_EVENTING_NS,
                EventingConstants.WSE_EN_IDENTIFIER, EventingConstants.WSE_EVENTING_PREFIX),
                subscription.getId());
        OMNamespace eventingNamespace = factory.createOMNamespace(EventingConstants.WSE_EVENTING_NS,
                EventingConstants.WSE_EVENTING_PREFIX);
        OMElement subscribeResponseElement = factory.createOMElement(
                EventingConstants.WSE_EN_SUBSCRIBE_RESPONSE, eventingNamespace);
        try {
            OMElement subscriptionManagerElement = EndpointReferenceHelper.toOM(
View Full Code Here

     * @param subscription
     * @return
     */
    public SOAPEnvelope genUnSubscribeResponse(SynapseSubscription subscription) {
        SOAPEnvelope message = factory.getDefaultEnvelope();
        OMNamespace eventingNamespace = factory.createOMNamespace(EventingConstants.WSE_EVENTING_NS,
                EventingConstants.WSE_EVENTING_PREFIX);
        OMElement dummyBody = factory.createOMElement("UnsubscribeResponse", eventingNamespace);
        message.getBody().addChild(dummyBody);
        return message;
    }
View Full Code Here

     * @param subscription
     * @return
     */
    public SOAPEnvelope genRenewSubscriptionResponse(SynapseSubscription subscription) {
        SOAPEnvelope message = factory.getDefaultEnvelope();
        OMNamespace eventingNamespace = factory.createOMNamespace(EventingConstants.WSE_EVENTING_NS,
                EventingConstants.WSE_EVENTING_PREFIX);
        OMElement renewResponseElement =
                factory.createOMElement(EventingConstants.WSE_EN_RENEW_RESPONSE, eventingNamespace);
        OMElement expiresElement =
                factory.createOMElement(EventingConstants.WSE_EN_EXPIRES, eventingNamespace);
View Full Code Here

     * @param subscription
     * @return
     */
    public SOAPEnvelope genGetStatusResponse(Subscription subscription) {
        SOAPEnvelope message = factory.getDefaultEnvelope();
        OMNamespace eventingNamespace = factory.createOMNamespace(EventingConstants.WSE_EVENTING_NS,
                EventingConstants.WSE_EVENTING_PREFIX);
        OMElement renewResponseElement = factory.createOMElement(
                EventingConstants.WSE_EN_GET_STATUS_RESPONSE, eventingNamespace);
        OMElement expiresElement =
                factory.createOMElement(EventingConstants.WSE_EN_EXPIRES, eventingNamespace);
View Full Code Here

       
        OMElement currentElem = elem;
        while (true) {
            Iterator iter = currentElem.getAllDeclaredNamespaces();
            while (iter.hasNext()) {
                OMNamespace ns = (OMNamespace) iter.next();
                if (prefix.equals(ns.getPrefix())) {
                    return ns.getNamespaceURI();    
                }
            }
            OMContainer parent = currentElem.getParent();
            if (parent != null && parent instanceof OMElement) {
                currentElem = (OMElement)parent;
View Full Code Here

        while (currentElem != null) {
            Iterator it = currentElem.getAllDeclaredNamespaces();
            while (it.hasNext()) {

                OMNamespace n = (OMNamespace) it.next();
                // Exclude the default namespace as explained in the Javadoc above
                if (n != null && !"".equals(n.getPrefix())) {

                    try {
                        xpath.addNamespace(n.getPrefix(), n.getNamespaceURI());
                    } catch (JaxenException je) {
                        String msg = "Error adding declared name space with prefix : "
                            + n.getPrefix() + "and uri : " + n.getNamespaceURI()
                            + " to the XPath : " + xpath;
                        log.error(msg);
                        throw new SynapseException(msg, je);
                    }
                }
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.