Examples of ServiceInvoker


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

    {
      Message msg_in = MessageFactory.getInstance().getMessage();
      try
      {
        payloadProxy.setPayload(msg_in, object);
        ServiceInvoker invoker = new ServiceInvoker(service);
        if (async)
        {
          invoker.deliverAsync(msg_in);
        }
        else
        {
          invoker.deliverSync(msg_in, timeout);
        }
      }
      catch (Throwable t)
      {
        if (t instanceof RuntimeException)
View Full Code Here

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

    @WebMethod
    public String sayHello(String toWhom) {
        System.out.println("HelloWorld Hit! " + toWhom);
        String results = "";
        try {
            ServiceInvoker deliveryAdapter;
            Message requestMessage;
            Message replyMessage = null;

            // Create the delivery adapter for the target service (you'd normally cache this!!)...
            deliveryAdapter = new org.jboss.soa.esb.client.ServiceInvoker("MyServiceCategory", "MyNativeClientService");
            // Create and populate the request message...
            requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
            requestMessage.getBody().add(toWhom); // inject the value from the WS client
            // Deliver the request message synchronously - timeout after 20 seconds...
            replyMessage = deliveryAdapter.deliverSync(requestMessage, 20000);

            if (replyMessage != null) {
                results = (String) replyMessage.getBody().get();
            } else {
                results = "Hello World: " + toWhom + " on " + new java.util.Date();
View Full Code Here

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

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

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

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

                throw new ConfigurationException("No EPR present in process instance") ;
            }
           
           
            if(epr instanceof LogicalEPR) {
                final ServiceInvoker invoker = ((LogicalEPR)epr).getServiceInvoker();
                invoker.deliverAsync(message);
            } else {
                final Courier courier = CourierFactory.getCourier(epr);
                try {
                    courier.deliver(message);
                } finally {
View Full Code Here

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

     * @throws MessageDeliverException
     */
    private ServiceInvoker getServiceInvoker() throws MessageDeliverException
    {
        String key = esbCategoryName + esbServiceName;
        final ServiceInvoker origInvoker = siCache.get(key) ;
        if (origInvoker != null) {
            return origInvoker;
        } else {
            ServiceInvoker invoker = new ServiceInvoker(esbCategoryName,  esbServiceName);
            siCache.put(key, invoker);
            return invoker;
        }
    }
View Full Code Here

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

                epr = EPRHelper.fromXMLString(replyToEPR.toString()) ;
            } else {
                throw new ConfigurationException("No EPR present in process instance") ;
            }
            if(epr instanceof LogicalEPR) {
                final ServiceInvoker invoker = ((LogicalEPR)epr).getServiceInvoker();
                invoker.deliverAsync(message);
            } else {
                final Courier courier = CourierFactory.getCourier(epr);
                try {
                    courier.deliver(message);
                } finally {
View Full Code Here

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

    {
        String key = esbCategoryName + esbServiceName;
        if (siCache.containsKey(key)) {
            return siCache.get(key);
        } else {
            ServiceInvoker invoker = new ServiceInvoker(esbCategoryName,  esbServiceName);
            siCache.put(key, invoker);
            return invoker;
        }
    }
View Full Code Here

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

      // 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",
            "WebserviceConsumer2");
     
      // Create and populate the request message...
      Message requestMessage = MessageFactory.getInstance().getMessage(
            MessageType.JAVA_SERIALIZED);
     
      // Deliver the request message synchronously - timeout after 20
      // seconds...
      deliveryAdapter.deliverAsync(requestMessage);

      // need to cleanup connection pool for service invoker
      //deliveryAdapter.close();
   }
View Full Code Here

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

      if (args[2] != null && !args[2].equals(""))
         msgText =  args[2];
     
      System.out.println("Inbound Data: " + msgText);
     
      ServiceInvoker invoker = new ServiceInvoker(category,serviceName);
      Message requestMessage;
      requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
      requestMessage.getBody().add(msgText);
     try {    
        invoker.deliverAsync(requestMessage); // no waiting for a response
        } catch (Exception e) {
            System.out.println("Exception caught by client: " + e);
        }
    }
View Full Code Here

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

      if (args[2] != null && !args[2].equals(""))
         msgText =  args[2];     

      System.out.println("Inbound Data: " + msgText);
     
      ServiceInvoker invoker = new ServiceInvoker(category,serviceName);
      Message requestMessage;
      Message replyMessage = null;           
      requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
      requestMessage.getBody().add(msgText);
     
    try {     
      replyMessage = invoker.deliverSync(requestMessage, 20000);
     
      System.out.println("Reply Message: " + replyMessage.getBody().get());
    } catch (Exception e) {
      System.out.println("Exception caught by client: " + e);
      Throwable cause = e.getCause();
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.