Package org.apache.axis2.clientapi

Examples of org.apache.axis2.clientapi.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();
            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


    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.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 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

    }


    public void doAsyncSpellingSuggestion(String word) {
        OMElement requestElement = getElement(word);
        Call call = null;
        try {
            call = new Call();
        } catch (AxisFault axisFault) {
            observer.updateError(axisFault.getMessage());
        }
        URL url = null;
        try {
            url =
                    new URL(PROTOCOL,
                            PropertyLoader.getGoogleEndpointURL(),
                            PropertyLoader.getGoogleEndpointServiceName());
            //url=new URL( "http","127.0.0.1",7070,"/search/beta2");
        } catch (MalformedURLException e) {
            observer.updateError(e.getMessage());
            ;
        }

        call.setTo(
                new EndpointReference(url.toString()));
        try {
            call.invokeNonBlocking("doGoogleSpellingSugg",
                    requestElement,
                    new GoogleCallBack(word));
        } catch (AxisFault axisFault) {
            observer.updateError(axisFault.getMessage());
        }
View Full Code Here

    }

    public void doSyncSpellingSuggestion(String word) {
        OMElement responseElement = null;
        OMElement requestElement = getElement(word);
        Call call = null;
        try {
            call = new Call();
        } catch (AxisFault axisFault) {
            observer.updateError(axisFault.getMessage());
        }
        URL url = null;
        try {
            url =
                    new URL(PROTOCOL,
                            PropertyLoader.getGoogleEndpointURL(),
                            PropertyLoader.getGoogleEndpointServiceName());
            //url=new URL( "http","127.0.0.1",7070,"/search/beta2");
        } catch (MalformedURLException e) {
            observer.updateError(e.getMessage());
        }

        call.setTo(
                new EndpointReference(url.toString()));
        try {
            responseElement =
                    call.invokeBlocking("doGoogleSpellingSugg",
                            requestElement);
        } catch (AxisFault axisFault) {
            observer.updateError(axisFault.getMessage());
        }
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(AddressingConstants.WSA_TO, 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

    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(AddressingConstants.WSA_TO, 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

    public static void main(String[] args) {
        try {
            OMElement payload = ClientUtil.getEchoOMElement();

            Call call = new Call();
            call.setTo(targetEPR);

            //The boolean flag informs the axis2 engine to use two separate transport connection
            //to retrieve the response.
            call.engageModule(new QName(Constants.MODULE_ADDRESSING));
            call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, true);

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

            StringWriter writer = new StringWriter();
            result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
            writer.flush();

            System.out.println(writer.toString());

            //Need to close the Client Side Listener.
            call.close();

        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

  private static String toEpr = "tcp://localhost:8080/axis2/services/MyService";
 
  public static void main(String[] args) throws AxisFault {
   
      Call  call = new Call();
      call.setTo(new EndpointReference(AddressingConstants.WSA_TO,toEpr));
      call.setTransportInfo(Constants.TRANSPORT_TCP,Constants.TRANSPORT_TCP,false);
      //call.engageModule(new QName(Constants.MODULE_ADDRESSING));
     
      OMElement result = call.invokeBlocking("echo", getPayload());
   
      try {
        XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out);
        result.serializeWithCache(new OMOutput(writer));
        writer.flush();
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.