Package org.apache.axis2.client

Examples of org.apache.axis2.client.ServiceClient.sendReceive()


            outMsgContext.getOperationContext().addMessageContext(outMsgContext);
        }

        try {
            if (i == WSDLConstants.MEP_CONSTANT_IN_OUT) {
                client.sendReceive(element);
            } else {
                client.sendRobust(element);
            }
        } catch (AxisFault axisFault) {
            env = getResponseEnvelope(client);
View Full Code Here


                ServiceClient client = new ServiceClient(context, null);
                client.getOptions().setTo(new EndpointReference(toAddress));
                client.getOptions().setAction("Event");
               
                ByteArrayInputStream in = new ByteArrayInputStream(messageAsStr.getBytes());
                client.sendReceive(new StAXOMBuilder(in).getDocumentElement());
            } catch (AxisFault e) {
                throw new EventException("Error sending a message from java script",e);
            } catch (XMLStreamException e) {
                throw new EventException("Error sending a message from java script", e);
            }
View Full Code Here

        options.setTo(new EndpointReference(targetEPR));
        options.setAction("urn:uploadFileUsingMTOM");
        options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);

        serviceClient.setOptions(options);
        OMElement response = serviceClient.sendReceive(payload);

        OMText binaryNode = (OMText) response.
                getFirstChildWithName(new QName("http://services.samples", "response")).
                getFirstChildWithName(new QName("http://services.samples", "image")).
                getFirstOMChild();
View Full Code Here

        options.setTransportInProtocol(Constants.TRANSPORT_TCP);
        options.setAction(Constants.AXIS2_NAMESPACE_URI+"/"+operationName.getLocalPart());

        ServiceClient sender = new ServiceClient(configContext, clientService);
        sender.setOptions(options);
        OMElement result = sender.sendReceive(operationName, payload);

        result.serialize(StAXUtils.createXMLStreamWriter(
                System.out));
        sender.cleanup();
    }
View Full Code Here

        options.setTransportInProtocol(Constants.TRANSPORT_TCP);
        options.setUseSeparateListener(true);

        ServiceClient sender = new ServiceClient(configContext, clientService);
        sender.setOptions(options);
        OMElement result = sender.sendReceive(operationName, payloadElement);

        result.serialize(StAXUtils.createXMLStreamWriter(
                System.out));
        sender.cleanup();
View Full Code Here

        opts.setAction("urn:getQuote");
        serviceclient.setOptions(opts);

        try {
            OMElement res = serviceclient.sendReceive(payload);
            output = res.getChildren().next().toString().contains(symbol + " Company");

        }
        catch (RemoteException e) {
            e.printStackTrace();
View Full Code Here

        int content_type = 0;
        // opts.setProperty(Constants.Configuration.CONTENT_TYPE,content_type);
        serviceclient.setOptions(opts);

        //try {
        output = serviceclient.sendReceive(payload);

//            output = res.getChildren().next().toString().contains("IBM Company");

        //    }
        //   catch (Exception e) {
View Full Code Here

        opts.setAction("urn:getQuote");

        serviceclient.setOptions(opts);

        try {
            OMElement res = serviceclient.sendReceive(payload);
            System.out.println(res.getChildren().next());
            output = res.getChildren().next().toString().contains("IBM Company");

        }
        catch (RemoteException e) {
View Full Code Here

        opts.setAction("urn:getQuote");
        serviceclient.setOptions(opts);

        try {
            OMElement res = serviceclient.sendReceive(payload);
            System.out.println(res.getChildren().next());
            output = res.getChildren().next().toString().contains("IBM");
            output = res.getChildElements().next().toString().contains("IBM");
            System.out.println(output);
            //assertTrue((res.getChildren().next()).toString().indexOf("IBM")>0) ;
View Full Code Here

        opts.setAction("urn:getQuote");
        serviceclient.setOptions(opts);

        try {
            output = serviceclient.sendReceive(payload);


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