Package org.apache.axis2.clientapi

Examples of org.apache.axis2.clientapi.Call



    public synchronized void sendMsg() throws AxisFault {
        search.trim();
        prevSearch = search;
        Call call = new Call();
        URL url = null;
        try {
                url = new URL("http", "api.google.com", "/search/beta2");
          //  url = new URL("http://127.0.0.1:8080/axis2/services/axisversion/viewVersion");
        } catch (MalformedURLException e) {
            e.printStackTrace();
            System.exit(0);
        }

        call.setTo(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));

        MessageContext requestContext = ClientUtil.getMessageContext(this);
        try {
            call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
            QName opName = new QName("urn:GoogleSearch", "doGoogleSearch");
            OperationDescription opdesc = new OperationDescription(opName);
         //   OperationDescription opdesc = new OperationDescription(new QName("viewVersion"));
            call.invokeNonBlocking(opdesc, requestContext, new ClientCallbackHandler(this.gui));

        } catch (AxisFault e1) {
            e1.printStackTrace();
        }
    }
View Full Code Here


    }

    public OMElement testEchoXMLSync(String fileName) throws Exception {

        OMElement payload = createEnvelope(fileName);
        Call call = new Call();
        call.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        call.setTo(targetEPR);
        // enabling MTOM in the client side
        call.set(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_FALSE);
        call.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP, false);
        return call.invokeBlocking(operationName
                .getLocalPart(),
                payload);
    }
View Full Code Here

    public OMElement sendFile(String fileName) throws Exception {

        OMElement payload = createEnvelope(fileName);

        Call call = new Call();
        call.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        call.setTo(targetEPR);
        // enabling MTOM in the client side
        call.set(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
        call.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP, false);
        return call.invokeBlocking(operationName
                .getLocalPart(),
                payload);

    }
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();
            call.setSoapAction("http://soap.amazon.com");
            call.setTo(new EndpointReference(url));
            call.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

            throw new FileNotFoundException("Repository Doesnot Exist");
        }
        //copy the LoggingModule.mar to "modules" folder.
        //then modify the axis2.xml that is generating there according to
        //phases that being included in the "module.xml"
        Call call = new Call(repository.getAbsolutePath());
        call.engageModule(new QName("LoggingModule"));
    }
View Full Code Here

    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();
            Call call = new Call();
            call.setTo(targetEPR);
            call.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);

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

            StringWriter writer = new StringWriter();
            result.serializeWithCache(XMLOutputFactory.newInstance()
                    .createXMLStreamWriter(writer));
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();
            call.setTo(new EndpointReference(url));
            call.setSoapAction("http://soap.amazon.com");
            call.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


    public synchronized void sendMsg() throws AxisFault {
        search.trim();
        prevSearch = search;
        Call call = new Call();
        URL url = null;
        try {
            url = new URL("http", "api.google.com","/search/beta2");
            //  url = new URL("http://127.0.0.1:8080/axis2/services/axisversion/viewVersion");
        } catch (MalformedURLException e) {
            e.printStackTrace();
            System.exit(0);
        }

        call.setTo(
                new EndpointReference(url.toString()));

        MessageContext requestContext = ClientUtil.getMessageContext(this);
        try {
            call.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);
            QName opName = new QName("urn:GoogleSearch", "doGoogleSearch");
            OperationDescription opdesc = new OperationDescription(opName);
            //   OperationDescription opdesc = new OperationDescription(new QName("viewVersion"));
            call.invokeNonBlocking(opdesc,
                    requestContext,
                    new ClientCallbackHandler(this.gui));

        } catch (AxisFault e1) {
            e1.printStackTrace();
View Full Code Here

    private static String toEpr = "http://localhost:8080/axis2/services/MyService";

    public static void main(String[] args) throws AxisFault {

        Call call = new Call();
        call.setTo(new EndpointReference(toEpr));
        call.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);
        call.setDoREST(true);

        OMElement result = call.invokeBlocking("echo", getPayload());

        try {
            XMLStreamWriter writer = XMLOutputFactory.newInstance()
                    .createXMLStreamWriter(System.out);
            result.serializeWithCache(writer);
View Full Code Here

        return id;
    }

    public static void main(String[] args) throws Exception {

        Call call = new Call();
        call.setTo(targetEPR);
        call.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP, false);

        //Blocking invocation via wsa mapping
        call.setWsaAction("urn:sample/echo");
        OMElement result = (OMElement) call.invokeBlocking("echo", getBody());

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

TOP

Related Classes of org.apache.axis2.clientapi.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.