Axis2
  1. Axis2
  2. AXIS2-5302

Enable streaming of the root part of a SwA/MTOM message

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.7.0
    • Component/s: kernel
    • Labels:
      None

      Description

      The Axiom API that Axis2 is currently using to process a SwA or MTOM message will always load the root part of the MIME message into memory, although Axiom 1.2.13 introduced a feature to avoid that. The Axis2 code (MIMEBuilder) needs to be changed to take advantage of that new feature.

        Issue Links

          Activity

          Hide
          Hudson added a comment -

          Integrated in Axis2 #1399 (See https://builds.apache.org/job/Axis2/1399/)
          AXIS2-5302: Enable streaming of the root part of a SwA/MTOM message. (Revision 1331783)

          Result = SUCCESS
          veithen :
          Files :

          • /axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/attachments/AttachmentUtils.java
          • /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/builder/MIMEBuilder.java
          Show
          Hudson added a comment - Integrated in Axis2 #1399 (See https://builds.apache.org/job/Axis2/1399/ ) AXIS2-5302 : Enable streaming of the root part of a SwA/MTOM message. (Revision 1331783) Result = SUCCESS veithen : Files : /axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/attachments/AttachmentUtils.java /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/builder/MIMEBuilder.java
          Hide
          Andreas Veithen added a comment - - edited

          With AXIOM-416 implemented the patch would be as follows:

          Index: modules/kernel/src/org/apache/axis2/builder/MIMEBuilder.java
          ===================================================================
          — modules/kernel/src/org/apache/axis2/builder/MIMEBuilder.java (revision 1331561)
          +++ modules/kernel/src/org/apache/axis2/builder/MIMEBuilder.java (working copy)
          @@ -71,7 +71,7 @@
          type = startInfo;
          }
          }

          • return builder.processDocument(attachments.getRootPartInputStream(),
            + return builder.processDocument(attachments.getRootPartInputStream(false),
            type, msgContext);
            }
            }

          However, this causes an issue in JAX-WS. In fact, multiple test cases in jaxws-integration are failing with the following exception:

          java.lang.IllegalStateException: The content of the MIME part has already been consumed
          at org.apache.axiom.attachments.PartImpl.getContent(PartImpl.java:154)
          at org.apache.axiom.attachments.PartImpl.getDataSource(PartImpl.java:234)
          at org.apache.axiom.attachments.PartDataHandler.getDataSource(PartDataHandler.java:50)
          at org.apache.axis2.jaxws.message.attachments.AttachmentUtils.findCachedAttachment(AttachmentUtils.java:88)
          at org.apache.axis2.jaxws.message.impl.MessageImpl.setMessageContext(MessageImpl.java:723)
          at org.apache.axis2.jaxws.core.MessageContext.<init>(MessageContext.java:122)
          at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:144)

          Show
          Andreas Veithen added a comment - - edited With AXIOM-416 implemented the patch would be as follows: Index: modules/kernel/src/org/apache/axis2/builder/MIMEBuilder.java =================================================================== — modules/kernel/src/org/apache/axis2/builder/MIMEBuilder.java (revision 1331561) +++ modules/kernel/src/org/apache/axis2/builder/MIMEBuilder.java (working copy) @@ -71,7 +71,7 @@ type = startInfo; } } return builder.processDocument(attachments.getRootPartInputStream(), + return builder.processDocument(attachments.getRootPartInputStream(false), type, msgContext); } } However, this causes an issue in JAX-WS. In fact, multiple test cases in jaxws-integration are failing with the following exception: java.lang.IllegalStateException: The content of the MIME part has already been consumed at org.apache.axiom.attachments.PartImpl.getContent(PartImpl.java:154) at org.apache.axiom.attachments.PartImpl.getDataSource(PartImpl.java:234) at org.apache.axiom.attachments.PartDataHandler.getDataSource(PartDataHandler.java:50) at org.apache.axis2.jaxws.message.attachments.AttachmentUtils.findCachedAttachment(AttachmentUtils.java:88) at org.apache.axis2.jaxws.message.impl.MessageImpl.setMessageContext(MessageImpl.java:723) at org.apache.axis2.jaxws.core.MessageContext.<init>(MessageContext.java:122) at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:144)

            People

            • Assignee:
              Andreas Veithen
              Reporter:
              Andreas Veithen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development