Package org.apache.axis2.client

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


        opts.setTo(myUniEP);
        opts.setAction("urn:getQuote");
        serviceClient.setOptions(opts);


        OMElement res = serviceClient.sendReceive(createPayLoad());
        System.out.println(res);
    }

    public static OMElement createPayLoad() {
        OMFactory fac = OMAbstractFactory.getOMFactory();
View Full Code Here


            options.setTo(epr);

            options.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
            options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

            OMElement result = client.sendReceive(element);
            return result;
        } catch (Exception ex) {
            throw AxisFault.makeFault(ex);
        }
    }
View Full Code Here

    Options options = new Options();
    options.setTo(targetEPR);
    options.setAction("urn:" + opName);
    ServiceClient sender = new ServiceClient();
    sender.setOptions(options);
    OMElement result = sender.sendReceive(payload);
    return result;
  }
 
  /**
   * Calls an operation of a target web service with the given parameters and
View Full Code Here

    Options options = new Options();
    options.setTo(targetEPR);
    options.setAction("urn:" + opName);
    ServiceClient sender = new ServiceClient();
    sender.setOptions(options);
    OMElement result = sender.sendReceive(payload);
    return result;
  }
 
  /**
   * Calls a REST operation of a target web service with the given parameters and
View Full Code Here

          .setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    }

    serviceClient.setOptions(options);
       
    OMElement element = serviceClient.sendReceive(payload);
    printResult(element);

    Thread.sleep(3600);

    serviceClient.cleanup();
View Full Code Here

//    options.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES,Boolean.TRUE);
    options.setProperty(HTTPConstants.CHUNKED, false);

    serviceClient.setOptions(options);
        serviceClient.addHeader(getPaypalWSTestHeader());
    OMElement element = serviceClient.sendReceive(payload);
    printResult(element);

    Thread.sleep(3600);

    serviceClient.cleanup();
View Full Code Here

            }
            if (trpUrl != null && !"null".equals(trpUrl)) {
                option.setProperty(Constants.Configuration.TRANSPORT_URL, trpUrl);
            }
            serviceClient.setOptions(option);
            OMElement result = serviceClient.sendReceive(payLoad);
            System.out.println(("Received reponse from the server:\n" + result));
        } else {
            System.out.println(("The meata data descriptor file is required"));
        }
    }
View Full Code Here

            ServiceClient client = new ServiceClient(ctx, null);
            Options options = new Options();
            options.setTo(new EndpointReference("http://localhost:"+getTestPort(0)+"/processes/helloWorld"));
            client.setOptions(options);

            OMElement responseElement = client.sendReceive(getPayload(bundleName));
            String response = DOMUtils.domToString(OMUtils.toDOM(responseElement));
            System.out.println(response);

            System.out.println(response);
            assertTrue(response.contains("<helloResponse") && response.contains("Hello " + bundleName + "!"));
View Full Code Here

            options.setAction("urn:approve");    //TODO
            sender = null;

            sender = new ServiceClient();
            sender.setOptions(options);
            OMElement response = sender.sendReceive(payload);
            corId = getCorrelationValue(response);
            if (corId == null) {
                log.error("Correlation value is null");
                context.completeWithFault(cid, new FaultException(new QName(LongRunningExtensionBundle.NS, "Correlation value is null")));
                return;
View Full Code Here

               
                // Invoking the serive in the TestCase-28 should fail. So handling it differently..
                if (i == 28) {
                    try {
                        //Blocking invocation
                        serviceClient.sendReceive(getOMElement());
                        fail("Service Should throw an error..");

                    } catch (AxisFault axisFault) {
                        assertEquals("Expected encrypted part missing", axisFault.getMessage());
                    }
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.