Package org.apache.axis2.clientapi

Examples of org.apache.axis2.clientapi.Call


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);
            call.setTo(new EndpointReference(url.toString()));
            call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
            call.setSoapAction(soapAction);

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

            OperationDescription opDesc = new OperationDescription(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 static SOAPEnvelope sendMsg(SunRound2ClientUtil util, String epUrl, String soapAction) throws AxisFault {

        SOAPEnvelope resEnv = null;
//                   EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO,"http://demo.openlinksw.com:80/Interop");
        Call call = null;
        URL url = null;
        try {
            call = new Call("target/test-resources/intregrationRepo");
            url = new URL(epUrl);
            call.setTo(new EndpointReference(url.toString()));
            call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
            call.setSoapAction(soapAction);

            AxisConfiguration axisConfig = new AxisConfigurationImpl();
            ConfigurationContext configCtx = new ConfigurationContext(axisConfig);
            MessageContext msgCtx = new MessageContext(configCtx);
            OperationDescription opDesc = new OperationDescription(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

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


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

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

            StringWriter writer = new StringWriter();


View Full Code Here

            url = new URL(epUrl);
        } catch (MalformedURLException e) {
            throw new AxisFault(e);
        }

        Call call = new Call("target/test-resources/intregrationRepo");
        call.setTo(new EndpointReference(url.toString()));
        call.setSoapAction(soapAction);
        call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
        SOAPEnvelope reqEnv = util.getEchoSoapEnvelope();


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


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

        return retEnv;
    }
View Full Code Here

        EndpointReference targetEPR = new EndpointReference("http://www.whitemesa.net:80/interop/r4/fault-rpc");

        try {


            Call call = new Call("target/test-resources/intregrationRepo");
            call.setTo(targetEPR);
            call.setExceptionToBeThrownOnSOAPFault(false);
            call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
            call.setSoapAction(soapAction);
            //Blocking invocation

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


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

        EndpointReference targetEPR = new EndpointReference("http://www.whitemesa.net/interop/r4/fault-rpc-complex");

        try {


            Call call = new Call("target/test-resources/intregrationRepo");
            call.setTo(targetEPR);
            call.setExceptionToBeThrownOnSOAPFault(false);
            call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
            call.setSoapAction(soapAction);

            //Blocking invocation

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


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

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


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

            //Blocking invocation

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

            StringWriter writer = new StringWriter();

            System.out.println(writer.toString());
View Full Code Here

    public MTOMEchoTestSingleTest(String testName) {
        super(testName);
    }
    public void runTest(boolean optimized) throws Exception {
        Call call = new Call("target/test-resources/intregrationRepo");
         call.setTo(targetEPR);
        call.set(Constants.Configuration.ENABLE_MTOM,
                Constants.VALUE_TRUE);
        call.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP, false);
        call.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");
         call.setTo(targetEPR);
        call.set(Constants.Configuration.ENABLE_MTOM,
                Constants.VALUE_TRUE);
        call.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP, false);
        call.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

        OMElement resultElem = call.invokeBlocking("EchoTestMultiple", BodyElements.bodyMultiple(optimized,repeat));
        responseAssertion(resultElem);
    }
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

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.