Package org.jboss.soa.esb.message

Examples of org.jboss.soa.esb.message.Message


     
      BPELInvoke invoke=new BPELInvoke(config);
     
      invoke.setBPELEngine(bpelEngine);
     
      Message mesg=MessageFactory.getInstance().getMessage();
     
      mesg.getBody().add("<request/>");
     
      invoke.process(mesg);
     
      fail("Should have caused an exception");
     
View Full Code Here


     
      BPELInvoke invoke=new BPELInvoke(config);
     
      invoke.setBPELEngine(bpelEngine);
     
      Message mesg=MessageFactory.getInstance().getMessage();
     
      mesg.getBody().add("<request/>");
     
      Message resp=invoke.process(mesg);
     
      // Check that response is a fault message with the correct fault code
      if (resp.getFault() == null) {
        fail("Response message should be a fault");
      }
     
      if (faultName.equals(resp.getBody().get(BPELInvoke.BODY_FAULT_CODE)) == false) {
        fail("QNames don't match: "+faultName+" against "+
            resp.getBody().get(BPELInvoke.BODY_FAULT_CODE));
      }
                 
    } catch(Exception e) {
      fail("Failed processing fault: "+e);
    }
View Full Code Here

   * @param message The request message
   * @return The optional response message
   * @throws Exception Failed to process the message
   */
  public Message process(Message message) throws Exception {
    Message ret=null;
   
    // Check the operation and service details are available
    if (_config.getAttribute(OPERATION) == null) {
      throw new RuntimeException("Property '"+OPERATION+"' has not been specified");
    }
View Full Code Here

  }
 
  protected Message handleResponse(org.w3c.dom.Element resp, javax.xml.namespace.QName faultName,
            String serviceName, MessagePayloadProxy proxy, boolean f_toText)
                      throws Exception {
    Message ret=null;

    if (resp != null) {
      ret = MessageFactory.getInstance().getMessage();
     
      try {
View Full Code Here

    String result=null;
   
        System.setProperty("javax.xml.registry.ConnectionFactoryClass",
              "org.apache.ws.scout.registry.ConnectionFactoryImpl");

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

      esbMessage.getBody().add(message);
     
        Message respMessage = new ServiceInvoker(serviceCategory, serviceName).deliverSync(esbMessage, timeout);
     
        result = (String)respMessage.getBody().get();

        return(result);
  }
View Full Code Here

      {
        System.err.println("Usage SendEsbMessage <category> <name> <text to send>");
        System.exit(1);
      }
     
      Message esbMessage = MessageFactory.getInstance().getMessage();

      esbMessage.getBody().add(args[2]);
     
      try {
        Message respMessage = new ServiceInvoker(args[0], args[1]).deliverSync(esbMessage, 5000);
     
        System.out.println("REPLY: "+respMessage.getBody().get());
      } catch(org.jboss.soa.esb.couriers.FaultMessageException fme) {
        System.out.println("FAULT TYPE (AS QNAME): "+fme.getReturnedMessage().getBody().get(ESB_FAULT_CODE));
        System.out.println("FAULT TYPE (AS STRING): "+fme.getReturnedMessage().getBody().get(BPEL_FAULT_CODE));
      System.out.println("FAULT MESSAGE: "+fme.getReturnedMessage().getBody().get(FAULT_MESSAGE));
      }
View Full Code Here

  Object val=proxy.getPayload(message);

  System.out.println("Payload="+val);

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

  proxy.setPayload(ret, val);

  return ret;  
  }
View Full Code Here

      {
        System.err.println("Usage SendEsbMessage <category> <name> <text to send>");
        System.exit(1);
      }
     
      Message esbMessage = MessageFactory.getInstance().getMessage();

      esbMessage.getBody().add(args[2]);
     
        Message respMessage = new ServiceInvoker(args[0], args[1]).deliverSync(esbMessage, 5000);
     
        System.out.println("REPLY: "+respMessage.getBody().get());
    }
View Full Code Here

  public static Message createErrorMessage (String type, Message input, Throwable problem)
  {
    if (input == null)
      throw new IllegalArgumentException();
   
    Message errorMessage = MessageFactory.getInstance().getMessage(input.getType());
   
    if (errorMessage == null)
      throw new IllegalArgumentException("Could not create error message from "+input.getType());
   
    if (modifyMessage(input, errorMessage))
    {
      errorMessage.getBody().add(Fault.THROWABLE_CONTENT, problem);
     
      try
      {
        errorMessage.getFault().setCode(new URI(type));
       
        /*
         * Is there an exception? If so, add the string as the reason.
         */
       
        if (problem != null)
          errorMessage.getFault().setReason(problem.toString());
      }
      catch (final Exception ex)
      {
        _logger.debug("Caught exception "+ex+" during message creation!");
       
View Full Code Here

    @Test
    public void correctDestinationName()
    {
        try {
            ContentBasedWiretap cbr = new ContentBasedWiretap(actions[1]);
            Message returnMessage = cbr.process(message);
            //the cbr should return a null message
            assertNotNull(returnMessage);
        } catch (Exception e) {
            assertTrue(false);
        }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.message.Message

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.