Package org.apache.axis2.rpc.client

Examples of org.apache.axis2.rpc.client.RPCCall.invokeBlocking()


      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


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

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

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

        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);
        OMElement result = (OMElement) call.invokeBlocking(operationName
                .getLocalPart(), payload);

        return result;
    }
View Full Code Here

      Call  call = new Call();
      call.setTo(new EndpointReference(AddressingConstants.WSA_TO,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(new OMOutput(writer));
        writer.flush();
View Full Code Here

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

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

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

            observer.updateError(e.getMessage());
        }

        call.setTo(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
        try {
            responseElement=(OMElement)call.invokeBlocking("doGoogleSpellingSugg",requestElement);
        } catch (AxisFault axisFault) {
            observer.updateError(axisFault.getMessage());
        }

View Full Code Here

        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);

        SOAPEnvelope env = call.invokeBlocking("echoString", envelope);
        assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "hello Axis2");
    }

    public void testadd() throws AxisFault {
        configureSystem("add");
View Full Code Here

        call.setClientOptions(options);
        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);
        SOAPEnvelope env = call.invokeBlocking("add", envelope);
        assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "20");
    }

    public void testaddSameRef() throws AxisFault {
        configureSystem("add");
View Full Code Here

        options.setTo(targetEPR);
        options.setTransportInfo(Constants.TRANSPORT_HTTP,
                Constants.TRANSPORT_HTTP,
                false);

        SOAPEnvelope env = call.invokeBlocking("add", envelope);
        assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "20");
    }

    public void testaddError() {
        try {
View Full Code Here

            call.setClientOptions(options);
            options.setTo(targetEPR);
            options.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);
            call.invokeBlocking("add", envelope);
            fail("This should fail with : " + "org.apache.axis2.AxisFault: Invalid reference :2");
        } catch (AxisFault axisFault) {
            String val = axisFault.getMessage();
            int index = val.indexOf("org.apache.axis2.AxisFault: Invalid reference :2");
            if (index < 0) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.