You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2007/02/13 11:18:44 UTC

svn commit: r506953 - in /webservices/axis2/trunk/java/modules/kernel: conf/ src/org/apache/axis2/transport/http/

Author: chamikara
Date: Tue Feb 13 02:18:42 2007
New Revision: 506953

URL: http://svn.apache.org/viewvc?view=rev&rev=506953
Log:
A paremeter into the 'http' transport if set, will cause the HTTP transport (which is optional) to be ommitted.
A fix to use the HOLD_RESPONSE property for Servlet case (this hd been added for SimpleAxisServer).

Modified:
    webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java

Modified: webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml?view=diff&rev=506953&r1=506952&r2=506953
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml Tue Feb 13 02:18:42 2007
@@ -173,8 +173,12 @@
     <transportSender name="http"
                      class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
         <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
-        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
-    </transportSender>
+        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+        
+        <!-- If following is set to 'true', optional action part of the Content-Type will not be added to the SOAP 1.2 messages -->
+        <!--  <parameter name="OmitSOAP12Action" locked="false">true</parameter>  --> 
+    </transportSender>
+    
     <transportSender name="https"
                      class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
         <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java?view=diff&rev=506953&r1=506952&r2=506953
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java Tue Feb 13 02:18:42 2007
@@ -268,12 +268,17 @@
                         contentType, req.getHeader(HTTPConstants.HEADER_SOAP_ACTION),
                         req.getRequestURL().toString());
 
-                if (pi.equals(InvocationResponse.SUSPEND)) {
+                Boolean holdResponse = (Boolean) msgContext.getProperty(RequestResponseTransport.HOLD_RESPONSE);
+                
+                if (pi.equals(InvocationResponse.SUSPEND) ||  (holdResponse!=null && Boolean.TRUE.equals(holdResponse))) {
                     ((RequestResponseTransport) msgContext.getProperty(RequestResponseTransport.TRANSPORT_CONTROL)).awaitResponse();
                 }
 
-                Object contextWritten =
-                        msgContext.getOperationContext().getProperty(Constants.RESPONSE_WRITTEN);
+                Object contextWritten = null;
+                OperationContext operationContext =  msgContext.getOperationContext();
+                
+                if (operationContext!=null)
+                	contextWritten = operationContext.getProperty(Constants.RESPONSE_WRITTEN);
 
                 res.setContentType("text/xml; charset="
                         + msgContext.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING));

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?view=diff&rev=506953&r1=506952&r2=506953
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java Tue Feb 13 02:18:42 2007
@@ -40,6 +40,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import javax.xml.namespace.QName;
 import javax.xml.stream.FactoryConfigurationError;
 import javax.xml.stream.XMLStreamException;
 import java.io.ByteArrayOutputStream;
@@ -161,6 +162,23 @@
 			if (mimeBoundaryProperty != null) {
 				format.setMimeBoundary((String) mimeBoundaryProperty);
 			}
+			
+			TransportOutDescription transportOut = msgContext.getConfigurationContext().
+										getAxisConfiguration().getTransportOut(new QName (Constants.TRANSPORT_HTTP));
+			
+			//if a parameter hs set been set, we will omit the SOAP action for SOAP 1.2 
+			if (transportOut!=null) {
+				Parameter param = transportOut.getParameter(HTTPConstants.OMIT_SOAP_12_ACTION);
+				Object value = null;
+				if (param!=null)
+					value = param.getValue();
+				
+				if (value!=null && JavaUtils.isTrueExplicitly(value)) {
+					if (msgContext.isSOAP11()!=true) {
+						msgContext.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, Boolean.TRUE);
+					}
+				}
+			}
 
 			// Trasnport URL can be different from the WSA-To. So processing
 			// that now.
@@ -382,9 +400,11 @@
 			}
 		}
 
-		if (soapActionString == null) {
+		//Since action is optional for SOAP 1.2 we can return null here.
+		if (soapActionString == null && messageContext.isSOAP11()) {
 			soapActionString = "\"\"";
 		}
+		
 		return soapActionString;
 	}
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java?view=diff&rev=506953&r1=506952&r2=506953
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/HTTPConstants.java Tue Feb 13 02:18:42 2007
@@ -469,6 +469,7 @@
     public static final String HTTP_METHOD_POST = "POST";
     public static final String CONTENT_TYPE = "Content-Type";
 
+    public static final String OMIT_SOAP_12_ACTION = "OmitSOAP12Action";
     /**
      * Method getBytes.
      *



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