Package org.apache.axis2.client

Examples of org.apache.axis2.client.Call


    private void axis2EngineRuns(String operation, OMElement element,
                                 Callback specificCallbackObject) {
        //endpoint uri is hard coded....
        String url = "http://webservices.amazon.com/onca/soap?Service=AWSSimpleQueueService";
        try {
            Call call = new Call();

            Options options = new Options();
            call.setClientOptions(options);
            options.setSoapAction("http://soap.amazon.com");
            options.setTo(new EndpointReference(url));
            options.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);
            call.invokeNonBlocking(operation, element, specificCallbackObject);
        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here


    private void axis2EngineRuns(String operation, OMElement element,
                                 Callback specificCallbackObject) {
        //endpoint uri is hard coded....
        String url = "http://webservices.amazon.com/onca/soap?Service=AWSSimpleQueueService";
        try {
            Call call = new Call();

            Options options = new Options();
            call.setClientOptions(options);
            options.setSoapAction("http://soap.amazon.com");
            options.setTo(new EndpointReference(url));
            options.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);
           
            call.invokeNonBlocking(operation, element, specificCallbackObject);
        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

            // Get the repository location from the args
            String repo = args[0];
            String port = args[1];

            OMElement payload = getEchoElement();
            Call call = new Call(repo);
            Options options = new Options();
            call.setClientOptions(options);
            options.setTo(new EndpointReference("http://127.0.0.1:" + port + "/axis2/services/SecureService"));
            options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
            options.setUseSeparateListener(false);
            options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);

            //Blocking invocation
            OMElement result = call.invokeBlocking("echo", payload);

            StringWriter writer = new StringWriter();
            result.serialize(XMLOutputFactory.newInstance()
                    .createXMLStreamWriter(writer));
            writer.flush();
View Full Code Here

        Options options = new Options();
        options.setTo(new EndpointReference(url.toString()));
        options.setSoapAction(soapAction);
        options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);

        Call call = new Call(clientHome);
        call.setClientOptions(options);
        SOAPEnvelope reqEnv = util.getEchoSoapEnvelope();


        AxisConfiguration axisConfig = new AxisConfiguration();
        ConfigurationContext configCtx = new ConfigurationContext(axisConfig);
        MessageContext msgCtx = new MessageContext(configCtx);
        msgCtx.setEnvelope(reqEnv);


        QName opName = new QName("");
        AxisOperation opDesc = new OutInAxisOperation(opName);
        MessageContext retMsgCtx = call.invokeBlocking(opDesc, msgCtx);
        //SOAPEnvelope responseEnvelop = replyContext.getEnvelope();
        retEnv = retMsgCtx.getEnvelope();

        return retEnv;
    }
View Full Code Here

public class SunRound3Client {

    public SOAPEnvelope sendMsg(SunRound3ClientUtil util, String epUrl, String soapAction) throws AxisFault {

        SOAPEnvelope retEnvelope = null;
        Call call = null;
        URL url = null;
        try {
            call = new Call("target/test-resources/intregrationRepo");
            //todo set the path to repository in Call()
            url = new URL(epUrl);

            Options options = new Options();
            call.setClientOptions(options);
            options.setTo(new EndpointReference(url.toString()));
            options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
            options.setSoapAction(soapAction);

            AxisConfiguration axisConfig = new AxisConfiguration();
            ConfigurationContext configCtx = new ConfigurationContext(axisConfig);
            MessageContext msgCtx = new MessageContext(configCtx);

            AxisOperation opDesc = new OutInAxisOperation(new QName(""));
            SOAPEnvelope requestEnvilope = util.getEchoSoapEnvelope();
            msgCtx.setEnvelope(requestEnvilope);
            MessageContext resMsgCtx = call.invokeBlocking(opDesc, msgCtx);
            retEnvelope = resMsgCtx.getEnvelope();

        } catch (Exception e) {
            throw new AxisFault(e);
        }
View Full Code Here

public class SunRound2Client {

    public static SOAPEnvelope sendMsg(SunRound2ClientUtil util, String epUrl, String soapAction) throws AxisFault {

        SOAPEnvelope resEnv = null;
        Call call = null;
        URL url = null;
        try {
            call = new Call("target/test-resources/intregrationRepo");
            url = new URL(epUrl);

            Options options = new Options();
            call.setClientOptions(options);
            options.setTo(new EndpointReference(url.toString()));
            options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
            options.setSoapAction(soapAction);

            AxisConfiguration axisConfig = new AxisConfiguration();
            ConfigurationContext configCtx = new ConfigurationContext(axisConfig);
            MessageContext msgCtx = new MessageContext(configCtx);
            AxisOperation opDesc = new OutInAxisOperation(new QName(""));
            SOAPEnvelope requestEnvilope = util.getEchoSoapEnvelope();
            msgCtx.setEnvelope(requestEnvilope);
            MessageContext responseMCtx = call.invokeBlocking(opDesc, msgCtx);
            resEnv = responseMCtx.getEnvelope();

        } catch (Exception e) {
            throw new AxisFault(e);
        }
View Full Code Here

        Options clientOptions = new Options();
        clientOptions.setTo(targetEPR);
        clientOptions.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP,
                false);

        Call call = new Call(clientHome);
        call.setClientOptions(clientOptions);


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

                OMElement data = (OMElement) envelope.getBody().getFirstElement().getFirstOMChild();
                compareWithCreatedOMText(data.getText());
                finish = true;
            }

            public void reportError(Exception e) {
                log.info(e.getMessage());
                finish = true;
            }
        };

        call.invokeNonBlocking(operationName.getLocalPart(),
                payload,
                callback);
        int index = 0;
        while (!finish) {
            Thread.sleep(1000);
            index++;
            if (index > 10) {
                throw new AxisFault(
                        "Server was shutdown as the async response take too long to complete");
            }
        }
        call.close();
    }
View Full Code Here

            clientOptions.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
            clientOptions.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP, false);
            clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

            Call call =
                     new Call(clientHome);
            call.setClientOptions(clientOptions);
           
            OMElement result = call.invokeBlocking(operationName
                    .getLocalPart(), payload);

            OMElement data = (OMElement) result.getFirstOMChild();
            compareWithCreatedOMText(data.getText());
            call.close();
            log.info("" + i);
            UtilServer.unDeployClientService();
        }
    }
View Full Code Here

        options.setTo(new EndpointReference(epr));
        options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
        options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
        options.setProperty(Constants.Configuration.ENABLE_REST_THROUGH_GET, Constants.VALUE_TRUE);

        Call call = new Call();
        call.setClientOptions(options);
        //if post is through GET of HTTP
        OMElement response = call.invokeBlocking("webSearch", data);
        response.serialize(System.out);
    }
View Full Code Here


    public void testEchoXMLSync() throws Exception {
        OMElement payload = createEnvelope();

        Call call = new Call("target/test-resources/integrationRepo");

        Options options = new Options();
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);
        options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);

        call.setClientOptions(options);
        OMElement result =
                call.invokeBlocking(operationName.getLocalPart(),
                        payload);
        result.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(
                System.out));


        call.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.client.Call

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.