You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2012/04/29 16:07:48 UTC

[jira] [Created] (AXIS2-5308) Attachments semantics are different for incoming and outgoing messages

Andreas Veithen created AXIS2-5308:
--------------------------------------

             Summary: Attachments semantics are different for incoming and outgoing messages
                 Key: AXIS2-5308
                 URL: https://issues.apache.org/jira/browse/AXIS2-5308
             Project: Axis2
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.6.2
            Reporter: Andreas Veithen
            Priority: Minor


The message builders for MTOM and SwA both initialize the message context with an Attachments object that contains all MIME parts, including the root part. On the other hand, the corresponding message formatters have different expectations. The message formatter for MTOM doesn't look at the Attachments object in the message context because attachments are referenced by special OMText instances in the SOAP envelope. Finally, the message formatter for SwA assumes that the Attachments object in the message context only contains the attachment parts.

This means that for MTOM and SwA messages, the message context is set up differently for incoming and outgoing messages. Such inconsistencies in the API are not only annoying, but they also cause subtile issues in Synapse which needs to be able to forward messages, i.e. transform incoming into outgoing messages. One such issue is described in SYNAPSE-867.

The proposal is to change the semantics for incoming messages, such that they match the current semantics for outgoing messages. In practice this means:

1. The Attachments object in the message context would no longer be set for MTOM messages. In fact, code that attempts to directly access the MIME parts of an MTOM message is broken by definition, because the sender is free to choose which base64Binary elements are sent as attachments and which ones are inlined.
2. The message builder for SwA would remove the root part from the Attachments object before adding it to the message context, so that application code only sees attachments parts. In fact, there is no valid use case where application code would want to retrieve the SOAP part directly from the Attachments object.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS2-5308) Attachments semantics are different for incoming and outgoing messages

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13265146#comment-13265146 ] 

Hudson commented on AXIS2-5308:
-------------------------------

Integrated in Axis2 #1410 (See [https://builds.apache.org/job/Axis2/1410/])
    AXIS2-5308: In the SwA case, remove the root part from the Attachments object before adding it to the message context, so that the Attachments object in the message context always contains attachment parts only (both for incoming and for outgoing messages). (Revision 1332311)

     Result = SUCCESS
veithen : 
Files : 
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/builder/SOAPBuilder.java

                
> Attachments semantics are different for incoming and outgoing messages
> ----------------------------------------------------------------------
>
>                 Key: AXIS2-5308
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5308
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.6.2
>            Reporter: Andreas Veithen
>            Priority: Minor
>
> The message builders for MTOM and SwA both initialize the message context with an Attachments object that contains all MIME parts, including the root part. On the other hand, the corresponding message formatters have different expectations. The message formatter for MTOM doesn't look at the Attachments object in the message context because attachments are referenced by special OMText instances in the SOAP envelope. Finally, the message formatter for SwA assumes that the Attachments object in the message context only contains the attachment parts.
> This means that for MTOM and SwA messages, the message context is set up differently for incoming and outgoing messages. Such inconsistencies in the API are not only annoying, but they also cause subtile issues in Synapse which needs to be able to forward messages, i.e. transform incoming into outgoing messages. One such issue is described in SYNAPSE-867.
> The proposal is to change the semantics for incoming messages, such that they match the current semantics for outgoing messages. In practice this means:
> 1. The Attachments object in the message context would no longer be set for MTOM messages. In fact, code that attempts to directly access the MIME parts of an MTOM message is broken by definition, because the sender is free to choose which base64Binary elements are sent as attachments and which ones are inlined.
> 2. The message builder for SwA would remove the root part from the Attachments object before adding it to the message context, so that application code only sees attachments parts. In fact, there is no valid use case where application code would want to retrieve the SOAP part directly from the Attachments object.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS2-5308) Attachments semantics are different for incoming and outgoing messages

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13265041#comment-13265041 ] 

Hudson commented on AXIS2-5308:
-------------------------------

Integrated in Axis2 #1409 (See [https://builds.apache.org/job/Axis2/1409/])
    Made the design of the message builders responsible for building SwA and MTOM messages a bit more object oriented by introducing a MIMEAwareBuilder extension interface. MIMEBuilder now essentially dispatches to an instance of that interface.

This allows us to use the proper Axiom API to build MTOM messages. It will also make it easier to implement AXIS2-5308. (Revision 1332277)

     Result = SUCCESS
veithen : 
Files : 
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/builder/MIMEAwareBuilder.java
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/builder/MIMEBuilder.java
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/builder/MTOMBuilder.java
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/builder/SOAPBuilder.java

                
> Attachments semantics are different for incoming and outgoing messages
> ----------------------------------------------------------------------
>
>                 Key: AXIS2-5308
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5308
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.6.2
>            Reporter: Andreas Veithen
>            Priority: Minor
>
> The message builders for MTOM and SwA both initialize the message context with an Attachments object that contains all MIME parts, including the root part. On the other hand, the corresponding message formatters have different expectations. The message formatter for MTOM doesn't look at the Attachments object in the message context because attachments are referenced by special OMText instances in the SOAP envelope. Finally, the message formatter for SwA assumes that the Attachments object in the message context only contains the attachment parts.
> This means that for MTOM and SwA messages, the message context is set up differently for incoming and outgoing messages. Such inconsistencies in the API are not only annoying, but they also cause subtile issues in Synapse which needs to be able to forward messages, i.e. transform incoming into outgoing messages. One such issue is described in SYNAPSE-867.
> The proposal is to change the semantics for incoming messages, such that they match the current semantics for outgoing messages. In practice this means:
> 1. The Attachments object in the message context would no longer be set for MTOM messages. In fact, code that attempts to directly access the MIME parts of an MTOM message is broken by definition, because the sender is free to choose which base64Binary elements are sent as attachments and which ones are inlined.
> 2. The message builder for SwA would remove the root part from the Attachments object before adding it to the message context, so that application code only sees attachments parts. In fact, there is no valid use case where application code would want to retrieve the SOAP part directly from the Attachments object.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS2-5308) Attachments semantics are different for incoming and outgoing messages

Posted by "Sagara Gunathunga (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13264561#comment-13264561 ] 

Sagara Gunathunga  commented on AXIS2-5308:
-------------------------------------------

+1 for your proposal and make it a clear API.
 Going further is there any possibility to use generic semantics for both MTOM and SwA ?
                
> Attachments semantics are different for incoming and outgoing messages
> ----------------------------------------------------------------------
>
>                 Key: AXIS2-5308
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5308
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.6.2
>            Reporter: Andreas Veithen
>            Priority: Minor
>
> The message builders for MTOM and SwA both initialize the message context with an Attachments object that contains all MIME parts, including the root part. On the other hand, the corresponding message formatters have different expectations. The message formatter for MTOM doesn't look at the Attachments object in the message context because attachments are referenced by special OMText instances in the SOAP envelope. Finally, the message formatter for SwA assumes that the Attachments object in the message context only contains the attachment parts.
> This means that for MTOM and SwA messages, the message context is set up differently for incoming and outgoing messages. Such inconsistencies in the API are not only annoying, but they also cause subtile issues in Synapse which needs to be able to forward messages, i.e. transform incoming into outgoing messages. One such issue is described in SYNAPSE-867.
> The proposal is to change the semantics for incoming messages, such that they match the current semantics for outgoing messages. In practice this means:
> 1. The Attachments object in the message context would no longer be set for MTOM messages. In fact, code that attempts to directly access the MIME parts of an MTOM message is broken by definition, because the sender is free to choose which base64Binary elements are sent as attachments and which ones are inlined.
> 2. The message builder for SwA would remove the root part from the Attachments object before adding it to the message context, so that application code only sees attachments parts. In fact, there is no valid use case where application code would want to retrieve the SOAP part directly from the Attachments object.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org