Package org.apache.axis2.client

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


                    }
                }

                else{
                    //Blocking invocation
                    serviceClient.sendReceive(getEchoElement());
                }
            }

            System.out.println("--------------Testing negative scenarios----------------------------");
View Full Code Here


                        loadPolicy("/rampart/policy/" + i + ".xml"));
                serviceClient.setOptions(options);

                try {
                    //Blocking invocation
                    serviceClient.sendReceive(getOMElement());
                    fail("Service Should throw an error..");

                } catch (AxisFault axisFault) {
                    assertEquals("Testing negative scenarios with Apache Rampart. Intentional Exception", axisFault.getMessage());
                }
View Full Code Here

            options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        }

        serviceClient.setOptions(options);

        OMElement element = serviceClient.sendReceive(payload);
        //serviceClient.fireAndForget(payload);
        printResult(element);

        Thread.sleep(3600);
View Full Code Here

            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

            options.setTo(reference.getEPR());
            options.setAction(DRConstants.SPEC.Actions.GET_METADATA_REQUEST);
           
            OMElement request = serviceClient.setupGetMetadataRequest(
                                                        MexConstants.SPEC.DIALECT_TYPE_POLICY,null);
            OMElement result = serviceClient.sendReceive(request);
           
            metadata.fromOM(result);
            MetadataSection[] mexSecs =  metadata.getMetadataSection(MexConstants.SPEC.DIALECT_TYPE_POLICY, null);
            OMElement policyElement = (OMElement) mexSecs[0].getInlineData();
           
View Full Code Here

            options.setTo(reference.getEPR());
            options.setAction(DRConstants.SPEC.Actions.GET_METADATA_REQUEST);
           
            OMElement request = serviceClient.setupGetMetadataRequest(
                                                        MexConstants.SPEC.DIALECT_TYPE_POLICY,null);
            OMElement result = serviceClient.sendReceive(request);
           
            metadata.fromOM(result);
            MetadataSection[] mexSecs =  metadata.getMetadataSection(MexConstants.SPEC.DIALECT_TYPE_POLICY, null);
            OMElement policyElement = (OMElement) mexSecs[0].getInlineData();
           
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.