Package org.apache.axis2.client

Examples of org.apache.axis2.client.Call


        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
        options.setUseSeparateListener(false);

        options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);

        Call call = new Call();
        call.setClientOptions(options);

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

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


    public OMElement sendFile(String fileName) throws Exception {

        OMElement payload = createEnvelope(fileName);

        Call call = new Call();

        Options options = new Options();
        options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        options.setTo(targetEPR);
        // enabling MTOM in the client side
        options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
        options.setUseSeparateListener(false);

        call.setClientOptions(options);
        return call.invokeBlocking(operationName
                .getLocalPart(),
                payload);

    }
View Full Code Here

        return id;
    }

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

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

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

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

            value.addChild(
                    fac.createText(value,
                            "Isaac Assimov, the foundation Sega"));
            method.addChild(value);

            Call call = new Call("target/test-resources/intregrationRepo");
            EndpointReference targetEPR =
                    new EndpointReference("http://127.0.0.1:"
                    + (UtilServer.TESTING_PORT)
                    + "/axis/services/EchoXMLService1");

            Options options = new Options();
            call.setClientOptions(options);
            options.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);
            options.setTo(targetEPR);
           
            SOAPEnvelope resEnv =
                    (SOAPEnvelope) call.invokeBlocking(
                            "echoOMElement", method);

            SOAPBody sb = resEnv.getBody();
            if (sb.hasFault()) {
                throw new AxisFault(
View Full Code Here

    }

    public void run() {
        try {
            log.info("Starting Thread number "+ threadNumber + " .............");
            Call call =
                    new Call("target/test-resources/intregrationRepo");
            OMElement payload = TestingUtils.createDummyOMElement();

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

            OMElement result =
                    call.invokeBlocking(operationName.getLocalPart(),
                            payload);
            TestingUtils.campareWithCreatedOMElement(result);
            call.close();
            log.info("Finishing Thread number "+ threadNumber + " .....");
        } catch (AxisFault axisFault) {
            thrownException = axisFault;
            log.error("Error has occured invoking the service ", axisFault);
        }
View Full Code Here

        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();

        OMElement payload = TestingUtils.createDummyOMElement();

        Options clientOptions = new Options();
        Call call = new Call(CLIENT_HOME);
        call.setClientOptions(clientOptions);

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

        OMElement result =
                call.invokeBlocking(operationName.getLocalPart(),
                        payload);
        TestingUtils.campareWithCreatedOMElement(result);
        call.close();
    }
View Full Code Here

     * @throws AxisFault
     */
    public static void sendMsg() throws AxisFault {
        search.trim();
        prevSearch = search;
        Call call = new Call();
        URL url = null;
        try {
            url =
                    new URL("http",
                            "soap.amazon.com",
                            "/onca/soap?Service=AlexaWebInfoService");

            /** Uncomment the folowing to use TCP Monitor, and comment the above */

            //url = new URL("http", "localhost",8080, "/onca/soap?Service=AlexaWebInfoService");

        } catch (MalformedURLException e) {
            e.printStackTrace();
        }

        Options options = new Options();
        call.setClientOptions(options);
        options.setTo(
                new EndpointReference(url.toString()));
        MessageContext requestContext = ClientUtil.getMessageContext();
        try {
            options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
            options.setUseSeparateListener(false);

            requestContext.getEnvelope().serializeAndConsume(
                    XMLOutputFactory.newInstance()
                            .createXMLStreamWriter
                            (System.out));
            QName opName = new QName("urn:GoogleSearch", "doGoogleSearch");
            AxisOperation opdesc = new OutInAxisOperation(opName);
            call.invokeNonBlocking(opdesc,
                    requestContext,
                    new ClientCallbackHandler());
        } catch (AxisFault e1) {
            e1.printStackTrace();
        } catch (XMLStreamException e) {
View Full Code Here

    }


    public RequestSecurityTokenResponse doRequest(RequestSecurityToken rst) throws TrustException {
        try {
            Call call = new Call();
            Options options = new Options();
            call.setClientOptions(options);
            options.setTo(new EndpointReference(this.stsUrl));
            options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, this.outConfig.getProperty());
            options.setProperty(WSSHandlerConstants.INFLOW_SECURITY, this.inConfig.getProperty());

            OMElement res = call.invokeBlocking(Constants.LN.REQUEST_SECURITY_TOKEN, this.prepareRequst(rst));
            RequestSecurityTokenResponse rstr = new RequestSecurityTokenResponse(res);
            return rstr;
        } catch (AxisFault e) {
            throw new TrustException("Problem in communicating with the SecurityTokenService", e);
        }
View Full Code Here

            Options options = new Options();
            options.setSoapAction("http://soap.amazon.com");
            options.setTo(new EndpointReference(url));
            options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);

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

            Options options = new Options();
            options.setTo(new EndpointReference(url));
            options.setSoapAction("http://soap.amazon.com");
            options.setTransportInfo(Constants.TRANSPORT_HTTP,
                    Constants.TRANSPORT_HTTP,
                    false);
            call.setClientOptions(options);
            call.invokeNonBlocking(operation, element, specificCallbackObject);
        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        } catch (Exception e) {
            e.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.