Package org.apache.ws.commons.om

Examples of org.apache.ws.commons.om.OMElement


        this.read = read;
        this.result = result;
    }

    public void run() {
        OMElement readQueueElement = OMElementCreator.read(
                this.createQueue.getText(), getKey());
        this.axis2EngineRuns("Read",
                readQueueElement,
                new SimpleQueueReadCallbackHandler(this.queueCode,
                        this.result));
View Full Code Here


        this.result = result;
    }

    public void run() {
        if (this.createQueue.isEditable()) {
            OMElement createQueueElement = OMElementCreator.creatQueueElement(
                    this.createQueue.getText(), getKey());
            this.axis2EngineRuns("CreateQueue",
                    createQueueElement,
                    new SimpleQueueCreateQueueCallbackHandler(this.createQueue,
                            this.queueCode,
                            this.enqueue, this.result));
        }
        if (this.enqueue.isEditable()) {
            OMElement enqueueElement = OMElementCreator.enqueueElement(
                    this.enqueue.getText(),
                    this.queueCode.getText(), getKey());
            this.axis2EngineRuns("Enqueue",
                    enqueueElement,
                    new SimpleQueueEnqueueCallbackHandler(this.createQueue,
View Full Code Here

    private void getQueueDeleteStatus(OMElement element) {
        Iterator iterator = element.getChildren();
        while (iterator.hasNext()) {
            OMNode omNode = (OMNode) iterator.next();
            if (omNode.getType() == OMNode.ELEMENT_NODE) {
                OMElement omElement = (OMElement) omNode;
                if (omElement.getLocalName().equals("Status")) {
                    this.readTheQueue(omElement);
                } else {
                    getQueueDeleteStatus(omElement);
                }
            }
View Full Code Here

    private static EndpointReference targetEPR = new EndpointReference("http://127.0.0.1:8080/axis2/services/MyService");

    public static void main(String[] args) {
        ServiceClient sender = null;
        try {
            OMElement payload = ClientUtil.getEchoOMElement();
            Options options = new Options();
            options.setTo(targetEPR);
            options.setAction("urn:echo");
            //The boolean flag informs the axis2 engine to use two separate transport connection
            //to retrieve the response.
            options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
            options.setUseSeparateListener(true);

            //Blocking Invocation
            sender = new ServiceClient();
            sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
            sender.setOptions(options);
            OMElement result = sender.sendReceive(payload);

            StringWriter writer = new StringWriter();
            result.serialize(XMLOutputFactory.newInstance()
                    .createXMLStreamWriter(writer));
            writer.flush();
            System.out.println(writer.toString());

            //Need to close the Client Side Listener.
View Full Code Here

    private boolean getResults(OMElement element) {
        Iterator iterator = element.getChildren();
        while (iterator.hasNext()) {
            OMNode omNode = (OMNode) iterator.next();
            if (omNode.getType() == OMNode.ELEMENT_NODE) {
                OMElement omElement = (OMElement) omNode;
                if ((omElement.getLocalName().equals("Status"))
                        || (omElement.getLocalName().equals("QueueId"))) {
                    this.getText(omElement);
                } else {
                    getResults(omElement);
                }
            }
View Full Code Here

        options.setTransportInProtocol(Constants.TRANSPORT_TCP);

        ServiceClient sender = new ServiceClient();
        sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
        sender.setOptions(options);
        OMElement result = sender.sendReceive(getPayload());

        try {
            XMLStreamWriter writer = XMLOutputFactory.newInstance()
                    .createXMLStreamWriter(System.out);
            result.serialize(writer);
            writer.flush();
        } catch (XMLStreamException e) {
            e.printStackTrace();
        } catch (FactoryConfigurationError e) {
            e.printStackTrace();
View Full Code Here

    private static OMElement getPayload() {
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs = fac.createOMNamespace(
                "tcp://localhost:8080/axis2/services/MyService", "example1");
        OMElement method = fac.createOMElement("echo", omNs);
        OMElement value = fac.createOMElement("Text", omNs);
        value.addChild(fac.createText(value, "Axis2 Echo String "));
        method.addChild(value);

        return method;
    }
View Full Code Here

    private boolean getResults(OMElement element) {
        Iterator iterator = element.getChildren();
        while (iterator.hasNext()) {
            OMNode omNode = (OMNode) iterator.next();
            if (omNode.getType() == OMNode.ELEMENT_NODE) {
                OMElement omElement = (OMElement) omNode;
                if ((omElement.getLocalName().equals("QueueId"))
                        || (omElement.getLocalName().equals("QueueName"))) {

                    if (omElement.getLocalName().equals("QueueId")) {
                        this.getText(omElement);
                    }
                    if (omElement.getLocalName().equals("QueueName")) {
                        this.getText(omElement);
                    }

                } else {
                    getResults(omElement);
View Full Code Here

public class ClientForWebServiceWithModule {
    private static EndpointReference targetEPR = new EndpointReference("http://127.0.0.1:8080/axis2/services/MyServiceWithModule");

    public static void main(String[] args) {
        try {
            OMElement payload = ClientUtil.getEchoOMElement();
            Options options = new Options();
            options.setTo(targetEPR);
            options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
            ServiceClient sender = new ServiceClient();
            sender.setOptions(options);
            OMElement result = sender.sendReceive(payload);


            StringWriter writer = new StringWriter();
            result.serialize(XMLOutputFactory.newInstance()
                    .createXMLStreamWriter(writer));
            writer.flush();
            System.out.println(writer.toString());

View Full Code Here

        options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);

        ServiceClient sender = new ServiceClient();
        sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
        sender.setOptions(options);
        OMElement result = sender.sendReceive(getPayload());

        try {
            XMLStreamWriter writer = XMLOutputFactory.newInstance()
                    .createXMLStreamWriter(System.out);
            result.serialize(writer);
            writer.flush();
        } catch (XMLStreamException e) {
            e.printStackTrace();
        } catch (FactoryConfigurationError e) {
            e.printStackTrace();
View Full Code Here

TOP

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