[ 
https://issues.apache.org/jira/browse/AXIS2-4760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12887242#action_12887242
 ] 

Andreas Veithen commented on AXIS2-4760:
----------------------------------------

There are actually multiple issues related to 
HTTPTransportUtils#initializeMessageContext:

1. The HTTPTransportUtils, TransportUtils and BuilderUtils contain multiple 
methods that implement Content-Type decoding logic. See e.g. 
TransportUtils#processContentTypeForAction, 
TransportUtils#getSOAPNamespaceFromContentType and 
BuilderUtils#getCharSetEncoding. There is much code duplication (e.g. the logic 
to process quoted values) and the decoding logic is implemented with very 
different degrees of conformance to the specs. Probably it would be much better 
to create a javax.mail.internet.ContentType object once from the Content-Type 
value and extract all necessary information from that object 
(javax.mail.internet.ContentType is known to parse the Content-Type value 
correctly). This may even perform better, considering the repeated usage of 
String#indexOf, JavaUtils#indexOfIgnoreCase, String#substring and String#trim 
in these methods.

2. The code in HTTPTransportUtils#initializeMessageContext is difficult to 
understand. E.g. to most people it will not be clear at first glance that the 
condition contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1 
actually catches plain SOAP 1.2 messages as well as MTOM messages.

3. HTTPTransportUtils#initializeMessageContext contains content type specific 
logic. The right place for this logic would be the corresponding 
org.apache.axis2.builder.Builder implementation.

4. HTTPTransportUtils#initializeMessageContext is used only in the HTTP 
transport. It is not clear why the logic that extracts the SOAP 1.2 action 
would not apply in the same way to the JMS and mail transports (both of which 
support Content-Type headers).

> Content-Type still not parsed correctly in MTOM SOAP 1.2 messages
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4760
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4760
>             Project: Axis2
>          Issue Type: Bug
>    Affects Versions: 1.5.1
>         Environment: axis2-1.5.1
>            Reporter: Valery Ushakov
>            Assignee: Andreas Veithen
>
> This is sort of a followup to 
> https://issues.apache.org/jira/browse/AXIS2-4076 I guess.
> Install axis2 and start the default standalone server that provides version 
> service.
> Send MTOM-encoded SOAP1.2 get version request, e.g. netcat something like the 
> following (I intentionally start with the case that works).  Important 
> details to note about this message:
> 1) wsa:Action header is present
> 2) SOAP action parameter is present both 
>   2a) inside start-info parameter (standard location) and
>   2b) as top-level parameter of the message Content-Type (where axis2 &co put 
> it).
> For further info about point #2 see 
> https://issues.apache.org/jira/browse/WSCOMMONS-290 
> POST /axis2/services/Version.VersionHttpSoap12Endpoint/ HTTP/1.1
> Content-Type: multipart/related;
>  boundary=B6331265-36EA-70D4-9375-0FF743A48AA2;
>  type="application/xop+xml";
>  action="urn:getVersion";
>  start-info="application/soap+xml; action=\"urn:getVersion\""
> Content-Length: 487
>  
> --B6331265-36EA-70D4-9375-0FF743A48AA2
> Content-Type: application/xop+xml; type="application/soap+xml; 
> action=\"urn:getVersion\""
>  
> <S12:Envelope
>    xmlns:S12="http://www.w3.org/2003/05/soap-envelope";
>    xmlns:wsa="http://www.w3.org/2005/08/addressing";>
>   <S12:Header>
>     <wsa:Action>urn:getVersion</wsa:Action>
>     <wsa:MessageID>urn:uuid:806D8FD2D542EDCC2C1199332890651</wsa:MessageID>
>   </S12:Header>
>   <S12:Body/>
> </S12:Envelope>
> --B6331265-36EA-70D4-9375-0FF743A48AA2--
> Normal getVersionResponse message is returned.
> Now change the order of action and start-info parameters in the message 
> content-type so that it looks like:
> Content-Type: multipart/related;
>  boundary=B6331265-36EA-70D4-9375-0FF743A48AA2;
>  type="application/xop+xml";
>  start-info="application/soap+xml; action=\"urn:getVersion\"";
>  action="urn:getVersion"
> Axis2 replies with a fault (prettified for readability):
> HTTP/1.1 500 A header representing a Message Addressing Property is not valid 
> and the message cannot be processed
> <soapenv:Envelope
>    xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";>
>   <soapenv:Header
>      xmlns:wsa="http://www.w3.org/2005/08/addressing";>
>     <wsa:Action>http://www.w3.org/2005/08/addressing/fault</wsa:Action>
>   </soapenv:Header>
>   <soapenv:Body>
>     <soapenv:Fault>
>       <soapenv:Code>
>       <soapenv:Value>
>         soapenv:Sender
>       </soapenv:Value>
>       <soapenv:Subcode>
>         <soapenv:Value
>            xmlns:wsa="http://www.w3.org/2005/08/addressing";>
>           wsa:InvalidAddressingHeader
>         </soapenv:Value>
>         <soapenv:Subcode>
>           <soapenv:Value
>              xmlns:wsa="http://www.w3.org/2005/08/addressing";>
>             wsa:ActionMismatch
>           </soapenv:Value>
>         </soapenv:Subcode>
>       </soapenv:Subcode>
>       </soapenv:Code>
>       <soapenv:Reason>
>       <soapenv:Text xml:lang="en-US">
>         Aheader representing a Message Addressing Property is not
>         valid and the message cannot be processed
>       </soapenv:Text>
>       </soapenv:Reason>
>       <soapenv:Detail>
>       <wsa:ProblemHeaderQName
>          xmlns:wsa="http://www.w3.org/2005/08/addressing";>
>         wsa:Action
>       </wsa:ProblemHeaderQName>
>       </soapenv:Detail>
>     </soapenv:Fault>
>   </soapenv:Body>
> </soapenv:Envelope>
> If I remove WS-A headers from the SOAP envelope then action/start-info order 
> works, while start-info/action mode results in 
> HTTP/1.1 500 The endpoint reference (EPR) for the Operation not found is 
> 10.125.133.56/axis2/services/Version.VersionHttpSoap12Endpoint/ and the WSA 
> Action = \"urn:getVersion\""
> So it looks like axis2 does pay attention to action parameter in start-info, 
> but does not parse it correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to