Package org.apache.axis2.client

Examples of org.apache.axis2.client.Call


    public MTOMEchoTestSingleTest(String testName) {
        super(testName);
    }

    public void runTest(boolean optimized) throws Exception {
        Call call = new Call("target/test-resources/intregrationRepo");
        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setProperty(Constants.Configuration.ENABLE_MTOM,
                Constants.VALUE_TRUE);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP, false);
        options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

        OMElement resultElem = call.invokeBlocking("EchoTestSingle", BodyElements.bodySingle(optimized));
        responseAssertion(resultElem, optimized);
    }
View Full Code Here


    public MTOMEchoTestMultipleTest(String testName) {
        super(testName);
    }

    public void runTest(boolean optimized, int repeat) throws Exception {
        Call call = new Call("target/test-resources/intregrationRepo");
        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setProperty(Constants.Configuration.ENABLE_MTOM,
                Constants.VALUE_TRUE);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP, false);
        options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

        OMElement resultElem = call.invokeBlocking("EchoTestMultiple", BodyElements.bodyMultiple(optimized, repeat));
        responseAssertion(resultElem);
    }
View Full Code Here

        EndpointReference targetEPR =
                new EndpointReference("http://soapinterop.java.sun.com:80/round4/grouph/simplerpcenc" );
        try {


            Call call = new Call();
             Options options = new Options();
        call.setClientOptions(options);
            options.setTo(targetEPR);
            options.setExceptionToBeThrownOnSOAPFault(false);
            options.setTransportInfo(Constants.TRANSPORT_HTTP,Constants.TRANSPORT_HTTP,false);
            options.setSoapAction(soapAction);
            //Blocking invocation

            firstchild = call.invokeBlocking("",util.getEchoOMElement());

        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();

View Full Code Here

           
            //parse the omEnvelope element and stuff it with the attachment
            //specific omText nodes
            insertAttachmentNodes(envelope, request);

            Call call = new Call();
            URL url = new URL(endpoint.toString());

            Options options = new Options();
            options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
            options.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);
            options.setTo(
                    new EndpointReference(url.toString()));
            call.setClientOptions(options);

            String axisOp = request.getSOAPBody().getFirstChild().getNodeName();
            NodeImpl bodyContentNode = (NodeImpl)request.getSOAPBody().getFirstChild();
            OMElement bodyContent = (OMElement)bodyContentNode.getOMNode();
            OMElement result = call.invokeBlocking(axisOp, bodyContent);
            org.apache.axis2.soap.SOAPEnvelope responseEnv = (org.apache.axis2.soap.SOAPEnvelope) ((OMElement)result.getParent()).getParent();
            SOAPEnvelopeImpl response = new SOAPEnvelopeImpl(responseEnv);
           
            SOAPMessageImpl sMsg = new SOAPMessageImpl(response);
            extractAttachmentNodes(responseEnv, sMsg);
View Full Code Here

                e.printStackTrace();
            }
            StAXOMBuilder builder = new StAXOMBuilder(reader);
            OMElement websearch = builder.getDocumentElement();

            Call call = new Call();

            Options options = new Options();
            call.setClientOptions(options);
            options.setTo(targetEPR);
            options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
            options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
            options.setProperty(HTTPConstants.HTTP_CONTENT_TYPE, "application/x-www-form-urlencoded");

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

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

    public void testEchoXMLSync() throws Exception {
        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
        //OMElement payload = createPayLoad();
        OMElement payload = getpayLoad();

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

        Options options = new Options();
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);
        options.setAction(operationName.getLocalPart());

        call.setClientOptions(options);

        OMElement result = call.invokeBlocking(operationName.getLocalPart(),
                payload);
        assertNotNull(result);
        OMElement person = (OMElement) result.getFirstOMChild();
        assertEquals(person.getLocalName(), "person");

        StringWriter writer = new StringWriter();
        result.build();
        result.serialize(writer);
        writer.flush();
        call.close();
    }
View Full Code Here

            e.printStackTrace();
        }
        StAXOMBuilder builder = new StAXOMBuilder(reader);
        OMElement data = builder.getDocumentElement();

        Call call = new Call();

        Options options = new Options();
        call.setClientOptions(options);
        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);

        //if post is through GET of HTTP
        OMElement response = call.invokeBlocking("webSearch", data);
        response.serialize(System.out);
    }
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());
            ;
        }

        Options options = new Options();
        call.setClientOptions(options);
        options.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());
        }

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

        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(
                new EndpointReference(url.toString()));

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

        } catch (AxisFault e1) {
            e1.printStackTrace();
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.