Package org.jboss.soa.esb.client

Examples of org.jboss.soa.esb.client.ServiceInvoker


    esbMessage.getContext().setContext(SecurityService.AUTH_REQUEST, PublicCryptoUtil.INSTANCE.encrypt((Serializable) authRequest));
   
        final String message = args[2];
        esbMessage.getBody().add(message);
       
        ServiceInvoker invoker = new ServiceInvoker(args[0], args[1]);
       
        try {
            invoker.deliverAsync(esbMessage);
        }catch(Exception ex) {
           ex.printStackTrace();
        }
        System.exit(0);
    }
View Full Code Here


       
        final EPR faultToEPR = new LogicalEPR("TestJBPMReplyESB", "Reply") ;
        faultToEPR.getAddr().addExtension(ReplyAction.REPLY_TYPE, "fault") ;
        call.setFaultTo(faultToEPR) ;
       
        final ServiceInvoker si = new ServiceInvoker("TestJBPMReplyESB", "Create") ;
        si.deliverAsync(message) ;
       
        final int numMessages = 4 ;
        final String[] messages = (String[])getServer().invoke(new ObjectName(RedeliveryMBean.objectName), "waitForMessages",
                new Integer[] {Integer.valueOf(numMessages)}, new String[] { Integer.TYPE.getName() });
    List messageList = Arrays.asList(messages);
View Full Code Here

      // Create the delivery adapter for the target service (cache it)
      System.setProperty("javax.xml.registry.ConnectionFactoryClass",
            "org.apache.ws.scout.registry.ConnectionFactoryImpl");

      // Create the delivery adapter for the target service (cache it)
      ServiceInvoker deliveryAdapter = new ServiceInvoker("MyServiceCategory",
            "Webserviceconsumer_wise4");
     

      // Create and populate the request message...
      Message requestMessage = MessageFactory.getInstance().getMessage(
            MessageType.JBOSS_XML);

      requestMessage.getBody().add(message);

      // Deliver the request message synchronously - timeout after 20
      // seconds...
      deliveryAdapter.deliverAsync(requestMessage);
   }
View Full Code Here

     
      Message esbMessage = MessageFactory.getInstance().getMessage();

      esbMessage.getBody().add(args[2]);
     
        new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
     
    }
View Full Code Here

      // Create the delivery adapter for the target service (cache it)
      System.setProperty("javax.xml.registry.ConnectionFactoryClass",
            "org.apache.ws.scout.registry.ConnectionFactoryImpl");

      // Create the delivery adapter for the target service (cache it)
      ServiceInvoker deliveryAdapter = new ServiceInvoker("MyServiceCategory",
            "Webserviceconsumer_wise3");
     

      // Create and populate the request message...
      Message requestMessage = MessageFactory.getInstance().getMessage(
            MessageType.JBOSS_XML);

      requestMessage.getBody().add(message);

      // Deliver the request message synchronously - timeout after 20
      // seconds...
      deliveryAdapter.deliverAsync(requestMessage);
   }
View Full Code Here

    }

    public void test_async() throws Exception {
        AbstractTestRunner testRunner = new AbstractTestRunner() {
            public void test() throws Exception {
                ServiceInvoker invoker = new ServiceInvoker("ServiceCat", "ServiceName");
                Message message = MessageFactory.getInstance().getMessage();

                message.getBody().add("Hi there!");
                invoker.deliverAsync(message);

                waitForMockSet(message);
                assertTrue("Message equality", checkMessageEquality(message, MockAction.message));
            }
        }.setServiceConfig("in-listener-config-01.xml");
View Full Code Here

    }

    public void test_sync_noerror() throws Exception {
        AbstractTestRunner testRunner = new AbstractTestRunner() {
            public void test() throws Exception {
                ServiceInvoker invoker = new ServiceInvoker("ServiceCat", "ServiceName");
                Message message = MessageFactory.getInstance().getMessage();

                message.getBody().add("Hi there!");
                Message response = invoker.deliverSync(message, 2000);

                assertTrue("Message equality", checkMessageEquality(message, MockAction.message));
                assertTrue("Message equality", checkMessageEquality(message, response));
            }
        }.setServiceConfig("in-listener-config-01.xml");
View Full Code Here

    }

    public void test_sync_error() throws Exception {
        AbstractTestRunner testRunner = new AbstractTestRunner() {
            public void test() throws Exception {
                ServiceInvoker invoker = new ServiceInvoker("ServiceCat", "ServiceName");
                Message message = MessageFactory.getInstance().getMessage();

                message.getBody().add("Hi there!");
                MockAction.exception = new ActionProcessingException("invm_sync_error");
                try {
                    invoker.deliverSync(message, 2000);
                    fail("Expected FaultMessageException.");
                } catch(FaultMessageException e) {
                    assertEquals("org.jboss.soa.esb.actions.ActionProcessingException: invm_sync_error", e.getMessage());
                }
            }
View Full Code Here

    }

    public void test_passByValue() throws Exception {
        AbstractTestRunner testRunner = new AbstractTestRunner() {
            public void test() throws Exception {
                ServiceInvoker invoker = new ServiceInvoker("ServiceCat", "ServiceName");
                Message message = MessageFactory.getInstance().getMessage();

                message.getBody().add("This message was passed by value!");
                invoker.deliverSync(message, 2000);

                assertTrue(message != MockAction.message);
                assertEquals("This message was passed by value!", MockAction.message.getBody().get());
            }
        }.setServiceConfig("in-listener-config-05.xml");
View Full Code Here

    }

    public void test_sync_multithreaded() throws Exception {
        AbstractTestRunner testRunner = new AbstractTestRunner() {
            public void test() throws Exception {
                ServiceInvoker invoker = new ServiceInvoker("ServiceCat", "ServiceName");
                ClientInvokerThread[] clients = new ClientInvokerThread[10];

                // Create the clients...
                for (int i = 0; i < clients.length; i++) {
                    clients[i] = new ClientInvokerThread(invoker);
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.client.ServiceInvoker

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.