Package org.switchyard.remote

Examples of org.switchyard.remote.RemoteMessage


        Order order = new Order();
        order.setItem("Turkey");
        order.setQuantity(1);

        // Create the request message
        RemoteMessage message = new RemoteMessage();
        message.setService(SERVICE).setOperation("submitOrder").setContent(order);

        // Invoke the service
        RemoteMessage reply = invoker.invoke(message);
        if (reply.isFault()) {
            System.err.println("Oops ... something bad happened.  " + reply.getContent());
        } else {
            OrderAck orderAck = (OrderAck) reply.getContent();
            out.println("==================================");
            out.println("Was the offer accepted? " + orderAck.isAccepted());
            out.println("Description: " + orderAck.getStatusDescription());
            out.println("Order ID: " + orderAck.getOrderId());
            out.println("==================================");
View Full Code Here


        // Create request payload
        Box box = new Box(new Widget("FF0000-ABC-123"));

        // Create the request message
        RemoteMessage message = new RemoteMessage();
        message.setService(SERVICE).setOperation("processRoute").setContent(box);

        // Invoke the service
        invoker.invoke(message);
    }
View Full Code Here

        // Create a new remote client invoker
        String port = System.getProperty("org.switchyard.component.sca.client.port", "8080");
        RemoteInvoker invoker = new HttpInvoker("http://localhost:" + port + "/switchyard-remote");

        // Create the request message
        RemoteMessage message = new RemoteMessage();
        message.setService(SERVICE).setOperation("acceptMessage").setContent(TEST_MESSAGE);

        // Invoke the service
        invoker.invoke(message);
    }
View Full Code Here

        // Create request payload
        Offer offer = createOffer(true);

        // Create the request message
        RemoteMessage message = new RemoteMessage();
        message.setService(SERVICE).setOperation("offer").setContent(offer);

        // Invoke the service
        RemoteMessage reply = invoker.invoke(message);
        if (reply.isFault()) {
            System.err.println("Oops ... something bad happened.  "
                + reply.getContent());
        } else {
            Deal deal = (Deal) reply.getContent();
            out.println("==================================");
            out.println("Was the offer accepted? " + deal.isAccepted());
            out.println("==================================");
        }
    }
View Full Code Here

        } else {
            offer = createOffer(true);
        }

        // Create the request message
        RemoteMessage message = new RemoteMessage();
        message.setService(SERVICE).setOperation("offer").setContent(offer);

        // Invoke the service
        RemoteMessage reply = invoker.invoke(message);
        if (reply.isFault()) {
            System.err.println("Oops ... something bad happened.  "
                + reply.getContent());
        } else {
            Deal deal = (Deal) reply.getContent();
            out.println("==================================");
            out.println("Was the offer accepted? " + deal.isAccepted());
            out.println("==================================");
        }
View Full Code Here

TOP

Related Classes of org.switchyard.remote.RemoteMessage

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.