Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement


        Callback callback)
    {
        final Method method = this.getMethod(
                operationName,
                arguments);
        OMElement omElement = this.getOperationElement(method, arguments);
        try
        {
            this.serviceClient.sendReceiveNonBlocking(
                omElement,
                callback);
View Full Code Here


        Object[] arguments)
    {
        final Method method = this.getMethod(
                operationName,
                arguments);
        OMElement omElement = this.getOperationElement(method, arguments);
        try
        {
            this.serviceClient.sendRobust(omElement);
        }
        catch (AxisFault exception)
View Full Code Here

    // Utils.addExcludeMethods(soapService.excludeMethods);
    // soapService.schemaGenerator.setExcludeMethods(soapService.excludeMethods);

    Parameter parameter = new Parameter(Constants.SERVICE_CLASS, soapService.serviceClass);
    OMElement paraElement = Utils.getParameter(Constants.SERVICE_CLASS, soapService.serviceClass, false);
    parameter.setParameterElement(paraElement);
    axisService.setUseDefaultChains(false);
    axisService.addParameter(parameter);
    axisService.setName(soapService.serviceName);
View Full Code Here

    protected OMElement serializeSpecificMediator(Mediator m) {
        if (!(m instanceof ThrottleMediator)) {
            handleException("Invalid Mediator has passed to serializer");
        }
        ThrottleMediator throttleMediator = (ThrottleMediator) m;
        OMElement throttle = fac.createOMElement("throttle", synNS);
        OMElement policy = fac.createOMElement("policy", synNS);
        String key = throttleMediator.getPolicyKey();
        if (key != null) {
            policy.addAttribute(fac.createOMAttribute(
                    "key", nullNS, key));
            throttle.addChild(policy);
        } else {
            OMNode inlinePolicy = throttleMediator.getInLinePolicy();
            if (inlinePolicy != null) {
                policy.addChild(inlinePolicy);
                throttle.addChild(policy);
            }
        }
        saveTracingState(throttle, throttleMediator);

        String id = throttleMediator.getId();
        if (id != null) {
            throttle.addAttribute(fac.createOMAttribute(
                    "id", nullNS, id));
        }

        String onReject = throttleMediator.getOnRejectSeqKey();
        if (onReject != null) {
            throttle.addAttribute(fac.createOMAttribute(XMLConfigConstants.ONREJECT, nullNS,
                    onReject));
        } else {
            Mediator mediator = throttleMediator.getOnRejectMediator();
            SequenceMediatorSerializer serializer = new SequenceMediatorSerializer();
            if (mediator != null && mediator instanceof SequenceMediator) {
                OMElement element = serializer.serializeAnonymousSequence(null,
                        (SequenceMediator) mediator);
                element.setLocalName(XMLConfigConstants.ONREJECT);
                throttle.addChild(element);
            }
        }
        String onAccept = throttleMediator.getOnAcceptSeqKey();
        if (onAccept != null) {
            throttle.addAttribute(fac.createOMAttribute(XMLConfigConstants.ONACCEPT, nullNS,
                    onAccept));
        } else {
            Mediator mediator = throttleMediator.getOnAcceptMediator();
            SequenceMediatorSerializer serializer = new SequenceMediatorSerializer();
            if (mediator != null && mediator instanceof SequenceMediator) {
                OMElement element = serializer.serializeAnonymousSequence(null,
                        (SequenceMediator) mediator);
                element.setLocalName(XMLConfigConstants.ONACCEPT);
                throttle.addChild(element);
            }
        }

        return throttle;
View Full Code Here

        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

        Iterator iter = elem.getChildrenWithName(MediatorProperty.PROPERTY_Q);

        while (iter.hasNext()) {

            OMElement propEle = (OMElement) iter.next();
            OMAttribute attName  = propEle.getAttribute(MediatorProperty.ATT_NAME_Q);
            OMAttribute attValue = propEle.getAttribute(MediatorProperty.ATT_VALUE_Q);
            OMAttribute attExpr  = propEle.getAttribute(MediatorProperty.ATT_EXPR_Q);

            MediatorProperty prop = new MediatorProperty();

            if (attName == null || attName.getAttributeValue() == null ||
                attName.getAttributeValue().trim().length() == 0) {
View Full Code Here

        String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" name=\"name\" " +
            "startOnLoad=\"true\"  transports=\"http\"><description>description</description>" +
            "<target inSequence=\"inseqname\" outSequence=\"outseqname\" faultSequence=\"faultseqname\" />" +
            "<publishWSDL uri=\"http://uri\" ></publishWSDL><policy key=\"key\"/>" +
            "<parameter name=\"para\">text</parameter></proxy>";
        OMElement inputOM = createOMElement(inputXml);
        ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties());
        OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
        assertTrue(compare(resultOM, inputOM));
    }
View Full Code Here

    public void testProxyServiceSerializationSenarioTwo() throws Exception {
        String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" startOnLoad=\"true\" " +
            "name=\"name\"  transports=\"http\"><description>description</description>" +
            "<target endpoint=\"epr\" outSequence=\"out\"/><publishWSDL key=\"key\">" +
            "</publishWSDL><policy key=\"key\"/><parameter name=\"para\">text</parameter></proxy>";
        OMElement inputOM = createOMElement(inputXml);
        ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties());
        OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
        assertTrue(compare(resultOM, inputOM));
    }
View Full Code Here

        String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" " +
            "name=\"name\" startOnLoad=\"true\"  transports=\"http\"><description>" +
            "description</description><target><inSequence onError=\"ref\"><description>Test documentation</description><send/></inSequence>" +
            "<outSequence><send/></outSequence></target><publishWSDL  key=\"key\"></publishWSDL>" +
            "<policy key=\"key\"/><parameter name=\"para\">text</parameter></proxy>";
        OMElement inputOM = createOMElement(inputXml);
        ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties());
        OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
        assertTrue(compare(resultOM, inputOM));
    }
View Full Code Here

        String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" " +
            "name=\"name\" startOnLoad=\"true\"  transports=\"http\"><description>" +
            "description</description><target><inSequence onError=\"ref\"><send/></inSequence>" +
            "<outSequence><send/></outSequence></target><enableAddressing/><publishWSDL  key=\"key\"></publishWSDL>" +
            "<policy key=\"key\"/><parameter name=\"para\">text</parameter></proxy>";
        OMElement inputOM = createOMElement(inputXml);
        ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties());
        OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
        assertTrue(compare(resultOM, inputOM));
    }
View Full Code Here

TOP

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

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.