Package nexj.core.meta.integration

Examples of nexj.core.meta.integration.Message


   /**
    * Tests that SOAP headers may be modified by sub-messages.
    */
   public void testParseSOAPHeader()
   {
      Message parentMessage = m_context.getMetadata().getMessage("XML_Inherit_SOAP_Header_Parent");
      Message childMessage = m_context.getMetadata().getMessage("XML_Inherit_SOAP_Header_Child");
      StringInput in = new StringInput(XML_HEADER +
         "<soap:Envelope" +
            " xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"" +
            " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" +
         "<soap:Header>" +
View Full Code Here


   /**
    * Test that SOAP headers may be replaced in a sub-message by a reference.
    */
   public void testFormatSOAPHeaderReference()
   {
      Message parentMessage = m_context.getMetadata().getMessage("XML_Inherit_SOAP_Header_Parent");
      Message childMessage = m_context.getMetadata().getMessage("XML_Inherit_SOAP_Header_Child_Header_Ref");
      StringWriter writer = new StringWriter();
      WriterOutput out = new WriterOutput(writer);
      TransferObject root = new TransferObject("XML_Inherit_SOAP_Header_Parent", 3);
      TransferObject headerRoot = new TransferObject(2);
      TransferObject actionHeader = new TransferObject(3);
View Full Code Here

   /**
    * Test that SOAP headers may be replaced in a sub-message by a reference.
    */
   public void testParseSOAPHeaderReference()
   {
      Message parentMessage = m_context.getMetadata().getMessage("XML_Inherit_SOAP_Header_Parent");
      Message childMessage = m_context.getMetadata().getMessage("XML_Inherit_SOAP_Header_Child_Header_Ref");
      StringInput in;
      TransferObject root;
      TransferObject headerRoot, actionHeader;

      // Parse child data using child Metadata
View Full Code Here

   /**
    * Test formatting a sub-message that doesn't override the SOAP headers.
    */
   public void testFormatSOAPHeaderSameHeader()
   {
      Message parentMessage = m_context.getMetadata().getMessage("XML_Inherit_SOAP_Header_Parent");
      Message childMessage = m_context.getMetadata().getMessage("XML_Inherit_SOAP_Header_Child_SameHeader");
      StringWriter writer = new StringWriter();
      WriterOutput out = new WriterOutput(writer);
      TransferObject root = new TransferObject("XML_Inherit_SOAP_Header_Child_SameHeader", 3);
      TransferObject headerRoot = new TransferObject(1);

View Full Code Here

   /**
    * Test parsing a sub-message that doesn't override the SOAP headers.
    */
   public void testParseSOAPHeaderSameHeader()
   {
      Message parentMessage = m_context.getMetadata().getMessage("XML_Inherit_SOAP_Header_Parent");
      Message childMessage = m_context.getMetadata().getMessage("XML_Inherit_SOAP_Header_Child_SameHeader");
      StringInput in;
      TransferObject root;
      TransferObject headerRoot;

      // Parse child data using child Metadata
View Full Code Here

    * can be used to "cast" it to Child3.
    */
   public void testParseMessageTableSiblings()
   {
      TransferObject root;
      Message msg1 = m_context.getMetadata().getMessage("XML_Inherit_Child1");
      Message msg2 = m_context.getMetadata().getMessage("XML_Inherit_Child2");
      Message msg3 = m_context.getMetadata().getMessage("XML_Inherit_Child3");
      Message msgp = m_context.getMetadata().getMessage("XML_Inherit_Parent");
      MessageTable table = new MessageTable();

      table.addMessage(msg1);
      table.addMessage(msg2);
      table.addMessage(msg3);
View Full Code Here

    *
    * This test exists to enforce the message inheritance specification.
    */
   public void testParseDocRootNameDoesNotFunctionLikeXSIType()
   {
      Message msgChild1 = m_context.getMetadata().getMessage("XML_Inherit_Child1");
      Message msgParent = m_context.getMetadata().getMessage("XML_Inherit_Parent");
      StringInput in;

      // Child1 is not polymorphic.
      in = new StringInput(XML_HEADER +
         "<child1child>" +
View Full Code Here

   /**
    * Tests parsing of messages with schemas and inheritance relationships.
    */
   public void testParseSchemaInherited()
   {
      Message msg1 = m_context.getMetadata().getMessage("XML_Inherit_Schema1");
      Message msg2 = m_context.getMetadata().getMessage("XML_Inherit_Schema2");
      Message msg3 = m_context.getMetadata().getMessage("XML_Inherit_Schema3");
      StringInput in;
      TransferObject root;

      // Valid root message
      in = new StringInput(
View Full Code Here

   /**
    * Tests formatting of messages with schemas and inheritance relationships.
    */
   public void testFormatSchemaInherited()
   {
      Message msg1 = m_context.getMetadata().getMessage("XML_Inherit_Schema1");
      StringWriter writer;
      WriterOutput out;
      TransferObject root;

      // Format sub-message
View Full Code Here

            {
               assert nArgCount == Pair.length(getArguments());

               InvocationContext context = (InvocationContext)machine.getContext();
               TransferObject tobj = (TransferObject)machine.getArg(0, nArgCount);
               Message message = context.getMetadata().getMessage(tobj.getClassName());
               Format format = message.getFormat();

               if (format == null || !format.getName().equals("Object"))
               {
                  throw new IntegrationException("err.integration.persistFormat",
                     new Object[]{message.getName(), (format == null) ? "" : message.getFormat().getName()});
               }

               context.getUnitOfWork().checkTransaction();

               ObjectOutput out = new ObjectOutput();
               MessageFormatter messageFormatter = (MessageFormatter)format.getFormatter().getInstance(context);

               cleanupToken = configureFormatter(messageFormatter, nArgCount, machine);

               if (messageFormatter instanceof ObjectMessageFormatter)
               {
                  ObjectMessageFormatter objMsgFmt = (ObjectMessageFormatter)messageFormatter;

                  logger = objMsgFmt.getLinkLogger();

                  if (logger != null && logger.isDumpEnabled())
                  {
                     logger.log(Logger.DUMP, "ids.sync.collectionFormattingStarted",
                        new Object[] {message.getName()}, null);
                  }
               }

               if (m_nOnError == FAIL_ON_ERROR)
               {
                  messageFormatter.format(tobj, message, out);
               }
               else
               {
                  ((ObjectMessageFormatter)messageFormatter).formatFailSafe(tobj, message, out, m_nOnError == COMMIT_ON_ERROR);
               }

               if (logger != null && logger.isDumpEnabled())
               {
                  logger.log(Logger.DUMP, "ids.sync.collectionFormattingCompleted",
                     new Object[] {message.getName()}, null);
               }

               Object obj = out.getObject();

               if (m_bRespond)
               {
                  Message response = message.getResponse();

                  if (response == null)
                  {
                     tobj = null;
                  }
View Full Code Here

TOP

Related Classes of nexj.core.meta.integration.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.