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 ch...@apache.org on 2005/09/07 05:18:30 UTC

svn commit: r279227 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java xml/src/org/apache/axis2/om/impl/OMOutputImpl.java

Author: chinthaka
Date: Tue Sep  6 20:18:16 2005
New Revision: 279227

URL: http://svn.apache.org/viewcvs?rev=279227&view=rev
Log:
Fixing Axis2-203. action parameter will be set properly now in SOAP 1.2 case, if available.

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/OMOutputImpl.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=279227&r1=279226&r2=279227&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java Tue Sep  6 20:18:16 2005
@@ -220,15 +220,22 @@
 
         private boolean doingMTOM = false;
 
+        private String soapActionString;
+
+        private MessageContext msgCtxt;
+
         public AxisRequestEntity(
                 OMElement element,
                 boolean chuncked,
-                boolean doingMTOM,
-                String charSetEncoding) {
+                MessageContext msgCtxt,
+                String charSetEncoding,
+                String soapActionString) {
             this.element = element;
             this.chuncked = chuncked;
-            this.doingMTOM = doingMTOM;
+            this.msgCtxt = msgCtxt;
+            this.doingMTOM = msgCtxt.isDoingMTOM();
             this.charSetEnc = charSetEncoding;
+            this.soapActionString = soapActionString;
         }
 
         public boolean isRepeatable() {
@@ -293,7 +300,13 @@
         }
 
         public String getContentType() {
-            return omOutput.getContentType();
+            String contentType = omOutput.getContentType();
+
+            // action header is not mandated in SOAP 1.2. So putting it, if available
+            if(!msgCtxt.isSOAP11() && soapActionString != null && !"".equals(soapActionString.trim())) {
+                contentType = contentType + " action=" + soapActionString + ";";
+            }
+            return contentType;
         }
     }
 
@@ -377,8 +390,10 @@
                 new AxisRequestEntity(
                         dataout,
                         chuncked,
-                        msgContext.isDoingMTOM(),
-                        charEncoding));
+                        msgContext,
+                        charEncoding,
+                        soapActionString));
+
 
         if (!httpVersion.equals(HTTPConstants.HEADER_PROTOCOL_10)
                 && chuncked) {
@@ -387,7 +402,7 @@
         postMethod.setRequestHeader(
                 HTTPConstants.HEADER_USER_AGENT,
                 "Axis/2.0");
-        if (!msgContext.isDoingREST()) {
+        if (msgContext.isSOAP11() && !msgContext.isDoingREST()) {
             postMethod.setRequestHeader(
                     HTTPConstants.HEADER_SOAP_ACTION,
                     soapActionString);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java?rev=279227&r1=279226&r2=279227&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java Tue Sep  6 20:18:16 2005
@@ -19,11 +19,11 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
-import org.apache.axis2.description.Parameter;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.attachments.MIMEHelper;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.Parameter;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.om.*;
 import org.apache.axis2.om.impl.MTOMConstants;
@@ -199,6 +199,7 @@
         } catch (AxisFault e) {
             throw new AxisFault(e);
         } catch (OMException e) {
+            e.printStackTrace();
             throw new AxisFault(e);
         } catch (XMLStreamException e) {
             throw new AxisFault(e);

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/OMOutputImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/OMOutputImpl.java?rev=279227&r1=279226&r2=279227&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/OMOutputImpl.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/OMOutputImpl.java Tue Sep  6 20:18:16 2005
@@ -145,10 +145,10 @@
             StringBuffer buf = new StringBuffer();
             if (!isSoap11) {
                 buf.append(SOAP12Constants.SOAP_12_CONTENT_TYPE);
-                buf.append("; charset=" + this.getCharSetEncoding());
+                buf.append("; charset=" + this.getCharSetEncoding() + ";");
             } else {
                 buf.append(SOAP11Constants.SOAP_11_CONTENT_TYPE)
-                    .append("; charset=" + this.getCharSetEncoding());
+                    .append("; charset=" + this.getCharSetEncoding() + ";");
             }
             return buf.toString();
         }