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 "Mike Rheinheimer (JIRA)" <ji...@apache.org> on 2007/09/25 17:18:50 UTC

[jira] Created: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

TransportUtils aggressively changing content type from text/xml to application/xml
----------------------------------------------------------------------------------

                 Key: AXIS2-3228
                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: kernel
            Reporter: Mike Rheinheimer


org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:

            // Some services send REST responces as text/xml. We should convert it to
            // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
            if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
                if (msgContext.isServerSide()) {
                    if (msgContext.getSoapAction() == null) {
                        type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
                    }
                } else if (msgContext.isDoingREST() &&
                        !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
                    type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
                }
            }
            Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);

The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).

Proposed fix:

I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:

Builder getBuilderForTextXML(String contentType) {
    if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
        return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
    } else {
            // Some services send REST responces as text/xml. We should convert it to
            // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
            if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
                if (msgContext.isServerSide()) {
                    if (msgContext.getSoapAction() == null) {
                        type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
                    }
                } else if (msgContext.isDoingREST() &&
                        !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
                    type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
                }
            }
            return BuilderUtil.getBuilderFromSelector(type, msgContext);
    }
}

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer updated AXIS2-3228:
------------------------------------

    Attachment: patch.txt

Patch is applied to axis2, SVN rev 577420 at root dir level.

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>         Attachments: patch.txt
>
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer updated AXIS2-3228:
------------------------------------

    Attachment:     (was: patch.txt)

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>         Attachments: patch.txt
>
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

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

Davanum Srinivas commented on AXIS2-3228:
-----------------------------------------

new patch looks good to me! makes sense to execute the aggressive only if rest is on!

-- dims

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>            Assignee: Deepal Jayasinghe
>         Attachments: patch_608910.txt
>
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer updated AXIS2-3228:
------------------------------------

    Attachment:     (was: patch2.txt)

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>            Assignee: Deepal Jayasinghe
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Assigned: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

Posted by "Deepal Jayasinghe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Deepal Jayasinghe reassigned AXIS2-3228:
----------------------------------------

    Assignee: Deepal Jayasinghe

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>            Assignee: Deepal Jayasinghe
>         Attachments: patch.txt, patch2.txt
>
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer updated AXIS2-3228:
------------------------------------

    Attachment: patch2.txt

There were some justified objections to the first patch proposal on the mailing list, especially considering that the builder is configurable in the axis2.xml file.  I explored a little more the check for Constants.Configuration.SOAP_RESPONSE_MEP.  How about if I move the check up to the outer 'if' conditional, and it would be the responsibility of the MessageContext creator (the servlet.doPost(), perhaps?) to set that property?  Thoughts?  Objections?  See patch2.txt

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>         Attachments: patch.txt, patch2.txt
>
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer updated AXIS2-3228:
------------------------------------

    Attachment:     (was: patch.txt)

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>            Assignee: Deepal Jayasinghe
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer updated AXIS2-3228:
------------------------------------

    Comment: was deleted

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>         Attachments: patch.txt
>
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530134 ] 

Mike Rheinheimer commented on AXIS2-3228:
-----------------------------------------

For clarity, the current default is to change the content type from text/xml to application/xml on the client upon receiving the async response message.  This is a bug.  The proposed solution would fix the bug AND enhance the runtime to allow for configuration override of this behavior.

Also, the new method would go best in BuilderUtils, not TransportUtils as I originally stated.  I'll prepare a patch and query the mailing list for consensus.

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer updated AXIS2-3228:
------------------------------------

    Attachment: patch.txt

Patch is applied to axis2, SVN rev 577420 at root dir.

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>         Attachments: patch.txt
>
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer resolved AXIS2-3228.
-------------------------------------

    Resolution: Fixed

Resolved in 610975

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>            Assignee: Deepal Jayasinghe
>         Attachments: patch_608910.txt
>
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml

Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Rheinheimer updated AXIS2-3228:
------------------------------------

    Attachment: patch_608910.txt

Attached a new patch with what I hope is the right fix.  HTTPTransportUtils.initializeMessageContext appears to set the isDoingREST, so we should be using that to less aggressively set the content-type in TransportUtils.createDocumentElement.  I'm testing this patch against a full axis2 build now, and will commit if it's good.

> TransportUtils aggressively changing content type from text/xml to application/xml
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3228
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3228
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>            Reporter: Mike Rheinheimer
>            Assignee: Deepal Jayasinghe
>         Attachments: patch_608910.txt
>
>
> org.apache.axis2.transport.TransportUtils.createDocumentElement aggressively pushes REST processing by performing the following checks.  This is breaking regular text/xml SOAP processing in some environments.  See code:
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             Builder builder = BuilderUtil.getBuilderFromSelector(type, msgContext);
> The failure case is the case where the client makes an async request.  In this case the reply message has content type "text/xml", isServerSide() passes due to the async client listening on a reply port (that's just the way it works...), and there is no soapAction.  All of the checks pass in the async case, changing the content type to application/xml, therefore picking the wrong builder (ApplicationXMLBuilder rather than SOAP11Builder).
> Proposed fix:
> I propose we add a configuration option such as BuilderForTextXML or similarly named, and move the above code to another TransportUtils method, such as:
> Builder getBuilderForTextXML(String contentType) {
>     if (msgContext.isPropertyTrue(Constants.Configuration.TEXTXML_IS_SOAP11)) {
>         return BuilderUtil.getBuilderFromSelector(HTTPConstants.MEDIA_TYPE_TEXT_XML, msgContext);
>     } else {
>             // Some services send REST responces as text/xml. We should convert it to
>             // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
>             if (HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
>                 if (msgContext.isServerSide()) {
>                     if (msgContext.getSoapAction() == null) {
>                         type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                     }
>                 } else if (msgContext.isDoingREST() &&
>                         !msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
>                     type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
>                 }
>             }
>             return BuilderUtil.getBuilderFromSelector(type, msgContext);
>     }
> }

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org