Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 32786 invoked from network); 10 Jan 2008 22:23:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jan 2008 22:23:00 -0000 Received: (qmail 1050 invoked by uid 500); 10 Jan 2008 22:22:46 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 988 invoked by uid 500); 10 Jan 2008 22:22:46 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 948 invoked by uid 99); 10 Jan 2008 22:22:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jan 2008 14:22:46 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jan 2008 22:22:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E81FC714201 for ; Thu, 10 Jan 2008 14:22:33 -0800 (PST) Message-ID: <26097871.1200003753936.JavaMail.jira@brutus> Date: Thu, 10 Jan 2008 14:22:33 -0800 (PST) From: "Davanum Srinivas (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Commented: (AXIS2-3228) TransportUtils aggressively changing content type from text/xml to application/xml In-Reply-To: <15051992.1190733530798.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on 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