Package org.switchyard.component.test.mixins.http

Examples of org.switchyard.component.test.mixins.http.HTTPMixIn.initialize()


     * @throws Exception if something goes wrong.
     */
    public static void main(final String[] args) throws Exception {

        HTTPMixIn soapMixIn = new HTTPMixIn();
        soapMixIn.initialize();

        try {
            String port = System.getProperty("org.switchyard.component.soap.client.port", "8080");
            String url = "http://localhost:" + port + "/quickstart-validate-xml/OrderService";
            String request = args.length == 0 ? XML : XML_INVALID;
View Full Code Here


        }
    }

    public static String sendMessage(String item, String quantity, String switchyard_web_service) throws Exception {
        HTTPMixIn http = new HTTPMixIn();
        http.initialize();
        return http.postString(switchyard_web_service, String.format(SOAP_TEMPLATE, item, quantity));
    }
}
View Full Code Here

            String portstr = System.getProperty(KEY_PORT);
            if (portstr != null) {
                port = Integer.parseInt(portstr);
            }
            HTTPMixIn http = new HTTPMixIn();
            http.initialize();
            String endpointURL = "http://localhost:" + port + "/http-binding/quote";
            System.out.println(" Request: " + endpointURL + " -> " + args[0]);
            String response = http.sendString(endpointURL, args[0], HTTPMixIn.HTTP_POST);
            System.out.println("Response: " + response);
        }
View Full Code Here

     * @throws Exception if something goes wrong.
     */
    public static void main(final String[] args) throws Exception {

        HTTPMixIn soapMixIn = new HTTPMixIn();
        soapMixIn.initialize();

        String xmldir = args[0];
        try {
            String port = System.getProperty("org.switchyard.component.soap.client.port", "8080");
            String url = "http://localhost:" + port + "/xts_wsat/BusinessTravelService";
View Full Code Here

    public static void main(String... args) throws Exception {
        final String ticketId = "TCKT-" + System.currentTimeMillis();
        final String soapRequest = new StringPuller().pull("/xml/soap-request.xml").replaceAll("TICKET_ID", ticketId);
        final HTTPMixIn http = new HTTPMixIn();
        http.initialize();
        try {
            String port = System.getProperty("org.switchyard.component.soap.client.port", "8080");
            http.postString("http://localhost:" + port + "/HelpDeskService/HelpDeskService", soapRequest);
            LOGGER.info("Started helpdesk process with ticket id: " + ticketId);
        } finally {
View Full Code Here

     * @throws Exception if something goes wrong.
     */
    public static void main(final String[] ignored) throws Exception {

        HTTPMixIn soapMixIn = new HTTPMixIn();
        soapMixIn.initialize();

        try {
            String port = System.getProperty("org.switchyard.component.soap.client.port", "8080");
            String url = "http://localhost:" + port + "/rules-interview/Interview";
            String result = soapMixIn.postFile(url, XML);
View Full Code Here

        String soapRequest = new StringPuller().pull("/xml/soap-request.xml").replaceAll("WORK_CMD", "CMD-" + System.currentTimeMillis());
        if (assertion != null) {
            soapRequest = soapRequest.replaceFirst("<!-- Assertion -->", XMLHelper.toString(assertion));
        }
        HTTPMixIn http = new HTTPMixIn();
        http.initialize();
        try {
            String endpoint = String.format("%s://localhost:%s/%s/WorkService", scheme, port, context);
            //LOGGER.info(String.format("Invoking work service at endpoint: %s with request: %s", endpoint, soapRequest));
            LOGGER.info(String.format("Invoking work service at endpoint: %s", endpoint));
            String soapResponse = http.postString(endpoint, soapRequest);
View Full Code Here

        }
    }

    public static void main(String... args) throws Exception {
        HTTPMixIn httpMixIn = new HTTPMixIn();
        httpMixIn.initialize();
        try {
            String port = System.getProperty("org.switchyard.component.soap.client.port", "8080");
            LibraryClient client = new LibraryClient(httpMixIn, port);
            client.testLibraryServices();
        } finally {
View Full Code Here

        String soapRequest = new StringPuller().pull("/xml/soap-request.xml").replaceAll("WORK_CMD", "CMD-" + System.currentTimeMillis());
        HTTPMixIn http = new HTTPMixIn();
        if (userPass != null && userPass.length == 2) {
            http.setRequestHeader("Authorization", "Basic " + Base64.encodeFromString(userPass[0] + ":" + userPass[1]));
        }
        http.initialize();
        try {
            String endpoint = String.format("%s://localhost:%s/%s/WorkService", scheme, port, context);
            //LOGGER.info(String.format("Invoking work service at endpoint: %s with request: %s", endpoint, soapRequest));
            LOGGER.info(String.format("Invoking work service at endpoint: %s", endpoint));
            String soapResponse = http.postString(endpoint, soapRequest);
View Full Code Here

        if (args.length == 0) {
            System.out.println("Usage: SoapBindingClient <some_name>");
            return;
        } else {
            HTTPMixIn http = new HTTPMixIn();
            http.initialize();
            String port = System.getProperty("org.switchyard.component.soap.client.port", "8080");
            SOAPUtil.prettyPrint(http.postString("http://localhost:" + port + "/soap-binding-rpc/HelloWorldWSService", String.format(SOAP_TEMPLATE, args[0], "English")), System.out);
        }
    }
}
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.