Package org.apache.axis2.client.async

Examples of org.apache.axis2.client.async.Callback


        Options clientOptions = new Options();
        clientOptions.setTo(targetEPR);
        clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);


        Callback callback = new Callback() {
            public void onComplete(AsyncResult result) {
                SOAPEnvelope envelope = result.getResponseEnvelope();

                OMElement data = (OMElement)envelope.getBody().getFirstElement().getFirstOMChild();
                compareWithCreatedOMText(data.getText());
View Full Code Here


        }

        // THIS NEXT PART WILL EVENTUALLY GO AWAY WHEN Callback DOES

        // OK, this must be an old-style Callback
        Callback callback = (Callback)callbackObj;
        AsyncResult result = new AsyncResult(msgContext);

        // check whether the result is a fault.
        try {
            SOAPEnvelope envelope = result.getResponseEnvelope();

            OperationContext opContext = msgContext.getOperationContext();
            if (opContext != null && !opContext.isComplete()) {
                opContext.addMessageContext(msgContext);
            }

            if (envelope.hasFault()) {
                AxisFault axisFault =
                        Utils.getInboundFaultFromMessageContext(msgContext);
                callback.onError(axisFault);
            } else {
                callback.onComplete(result);
            }
        } catch (Exception e) {
            callback.onError(e);
        finally {
            callback.setComplete(true);
        }
    }
View Full Code Here

        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);

        Callback callback = new Callback() {
            public void onComplete(AsyncResult result) {
                TestingUtils.campareWithCreatedOMElement(
                        result.getResponseEnvelope().getBody().getFirstElement());
                finish = true;
            }
View Full Code Here

                    Constants.TRANSPORT_HTTP,
                    true);
            options.setAction(operationName.getLocalPart());
            call.setClientOptions(options);

            Callback callback = new Callback() {
                public void onComplete(AsyncResult result) {
                    TestingUtils.campareWithCreatedOMElement(
                            result.getResponseEnvelope().getBody()
                            .getFirstElement());
                    finish = true;
View Full Code Here

            options.setTo(targetEPR);
            options.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);

            Callback callback = new Callback() {
                public void onComplete(AsyncResult result) {
                    TestingUtils.campareWithCreatedOMElement(
                            result.getResponseEnvelope()
                                    .getBody().getFirstElement());
                    finish = true;
View Full Code Here

            options.setTo(targetEPR);
            options.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    true);

            Callback callback = new Callback() {
                public void onComplete(AsyncResult result) {
                    TestingUtils.campareWithCreatedOMElement(
                            result.getResponseEnvelope()
                                    .getBody().getFirstElement());
                    finish = true;
View Full Code Here

        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);

        Callback callback = new Callback() {
            public void onComplete(AsyncResult result) {
                TestingUtils.campareWithCreatedOMElement(
                        result.getResponseEnvelope().getBody().getFirstElement());
                finish = true;
            }
View Full Code Here

            options.setTo(targetEPR);
            options.setTransportInfo(Constants.TRANSPORT_TCP,
                    Constants.TRANSPORT_TCP,
                    true);
            options.setAction(operationName.getLocalPart());
            Callback callback = new Callback() {
                public void onComplete(AsyncResult result) {
                    try {
                        result.getResponseEnvelope().serializeAndConsume(XMLOutputFactory.newInstance()
                                .createXMLStreamWriter(System.out));
                    } catch (XMLStreamException e) {
View Full Code Here

        call.engageModule(new QName(Constants.MODULE_ADDRESSING));
        options.setTransportInfo(Constants.TRANSPORT_TCP,
                Constants.TRANSPORT_TCP,
                false);

        Callback callback = new Callback() {
            public void onComplete(AsyncResult result) {
                try {
                    result.getResponseEnvelope().serialize(XMLOutputFactory.newInstance()
                            .createXMLStreamWriter(System.out));
                } catch (XMLStreamException e) {
View Full Code Here

        options.setTransportInfo(Constants.TRANSPORT_MAIL,
                Constants.TRANSPORT_MAIL,
                true);
        call.setClientOptions(options);

        Callback callback = new Callback() {
            public void onComplete(AsyncResult result) {
                try {
                    result.getResponseEnvelope().serializeAndConsume(XMLOutputFactory.newInstance()
                            .createXMLStreamWriter(System.out));
                } catch (XMLStreamException e) {
View Full Code Here

TOP

Related Classes of org.apache.axis2.client.async.Callback

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.