Package org.jboss.soa.esb.message

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


        return message;
    }

    public Message playWithMessage(Message message) throws Exception {
        Header msgHeader = message.getHeader();
        Body msgBody = message.getBody();
        Call theCall = msgHeader.getCall();
        EPR theEpr = theCall.getFrom();
        String contents = (String) msgBody.get();
        StringBuffer sb = new StringBuffer();
        sb.append("BEFORE\n");
        sb.append(contents);
        sb.append("\nAFTER");
        msgBody.add(sb.toString());
        return message;
    }
View Full Code Here


        logFooter();
        return message;
    }

    public Message playWithMessage(Message message) throws Exception {
        Body msgBody = message.getBody();
        String contents = (String) msgBody.get();

        // Reset the message body contents with the response...
        msgBody.add(("Hello From ESB MyAction: " + contents));

        throw new ActionProcessingException("Break!!!!");

        //return message;
    }
View Full Code Here

      return message;          
  }
 
   public Message playWithMessage(Message message) throws Exception {
//     Header msgHeader = message.getHeader();
     Body msgBody = message.getBody();
//     Call theCall = msgHeader.getCall();
//     EPR theEpr = theCall.getFrom();
     String contents = new String((byte[])msgBody.get());
     StringBuffer sb = new StringBuffer();
     sb.append("\nBEFORE\n");
     sb.append(contents);
     sb.append("\nAFTER\n");
     msgBody.add(sb.toString());
     return message;
   }
View Full Code Here

      logFooter();
      return message;          
  }
 
   public Message playWithMessage(Message message) throws Exception {
     Body msgBody = message.getBody();
     String results = new String();
     String contents = new String((String)msgBody.get());
     try {
         InitialContext ctx = new InitialContext();
              
         HelloWorld client = (HelloWorld) ctx.lookup("HelloWorldBean/remote");
         results = client.sayHello(contents);
         System.out.println("Invoked EJB3: " + results);
     } catch (Exception e) {
     e.printStackTrace();
         System.out.println(e);
     }
     msgBody.add(results);
     return message;
   }
View Full Code Here

      configTree = config;
   }

   public Message insertOrder(Message message) throws Exception
   {
      Body msgBody = message.getBody();
      XStream xstream = new XStream(new DomDriver());
      xstream.alias("order", Order.class);
      Order order = (Order) xstream.fromXML((String) msgBody.get());

      PetStoreFacade petStore = (PetStoreFacade) getBeanFactory()
            .getBean("petStore");
      petStore.insertOrder(order);
View Full Code Here

      return message;          
  }
 
   public Message playWithMessage(Message message) throws Exception {
//     Header msgHeader = message.getHeader();
     Body msgBody = message.getBody();
//     Call theCall = msgHeader.getCall();
//     EPR theEpr = theCall.getFrom();
     String contents = msgBody.get().toString();
     StringBuffer sb = new StringBuffer();
     sb.append("\nBEFORE**\n");
     sb.append(contents);
     sb.append("\nAFTER**\n");
     msgBody.add(sb.toString());
     return message;
   }
View Full Code Here

            throw new ObjectMappingException(expression + " should start with [<location>.]<name>") ;
        }
        String location = path[0];
        String name     = path[1];
        if ("body".equalsIgnoreCase(location)) {
            Body body   = message.getBody();
            try {
                object =
                    BODY_CONTENT.equals(name)
                    ? payloadProxy.getPayload(message)
                    : body.get(name);
            } catch (MessageDeliverException e) {
                throw new ObjectMappingException("Unable to get payload '" + name + "' from message.", e);
            }
        } else if ("properties".equalsIgnoreCase(location)) {
            object = message.getProperties().getProperty(name);
View Full Code Here

            throw new ObjectMappingException("Only 'header' and 'body' can contain hierarchical names: " + expression) ;
        }
        String location = path[0];
        String name     = path[1];
        if ("body".equalsIgnoreCase(location)) {
            Body body   = message.getBody();
            if (path.length == 2) {
                if (BODY_CONTENT.equals(name)) {
                    try {
                        payloadProxy.setPayload(message, object);
                    } catch (MessageDeliverException e) {
                        throw new ObjectMappingException("Unable to set payload on message.", e) ;
                    }
                } else {
                    body.add(name, object);
                }
            } else {
                final Object bodyObject ;
                if (BODY_CONTENT.equals(name)) {
                    try {
                        bodyObject = payloadProxy.getPayload(message) ;
                    } catch (final MessageDeliverException mde) {
                        throw new ObjectMappingException("Unable to get payload from message.", mde) ;
                    }
                } else {
                    bodyObject = body.get(name) ;
                }
               
                if (bodyObject == null) {
                    throw new ObjectMappingException("Unable to set property on named object: " + name + ", object does not exist in message") ;
                }
View Full Code Here

                {
                    final FaultMessageException fme = (FaultMessageException) ex ;
                    final Message faultMessage = fme.getReturnedMessage() ;
                    if (faultMessage != null)
                    {
                        final Body body = faultMessage.getBody() ;
                        final QName faultCode = (QName)body.get(Fault.DETAIL_CODE_CONTENT) ;
                        final String faultDescription = (String)body.get(Fault.DETAIL_DESCRIPTION_CONTENT) ;
                        final String faultDetail = (String)body.get(Fault.DETAIL_DETAIL_CONTENT) ;

                        if (faultCode != null)
                        {
                            faultMsg = SOAP_MESSAGE_FACTORY.createMessage() ;
                            final SOAPFault fault = faultMsg.getSOAPBody().addFault(faultCode, faultDescription) ;
View Full Code Here

     * @deprecated use BEFORE_ACTION and CURRENT_ACTION instead.
     */
   
    public static void copyCurrentToPrevious(Message message)
    {
      Body body = message.getBody();
      body.remove(PRE_ACTION_DATA);
      Object obj = body.get(POST_ACTION_DATA);
      if (null != obj)
        body.add(PRE_ACTION_DATA,obj);
    }
View Full Code Here

TOP

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

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.