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 he...@apache.org on 2005/08/02 13:18:20 UTC

svn commit: r226984 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis2/transport/http/ samples/

Author: hemapani
Date: Tue Aug  2 04:17:42 2005
New Revision: 226984

URL: http://svn.apache.org/viewcvs?rev=226984&view=rev
Log:
fixed the http://issues.apache.org/jira/browse/AXIS2-115

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/SimpleHTTPOutputStream.java
    webservices/axis/trunk/java/modules/samples/project.xml

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java?rev=226984&r1=226983&r2=226984&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/CommonsHTTPTransportSender.java Tue Aug  2 04:17:42 2005
@@ -375,23 +375,6 @@
                 soapActionString);
         }
         postMethod.setRequestHeader(HTTPConstants.HEADER_HOST, url.getHost());
-//        if (msgContext.isDoingMTOM()) {
-//            postMethod.setRequestHeader(
-//                HTTPConstants.HEADER_CONTENT_TYPE,
-//                omOutput.getContentType());
-//        } else {
-//            if (charEncoding == null) //Use default encoding scheme
-//                postMethod.setRequestHeader(
-//                    HTTPConstants.HEADER_CONTENT_TYPE,
-//                    "text/xml; charset="
-//                        + MessageContext.DEFAULT_CHAR_SET_ENCODING);
-//            else
-//                postMethod.setRequestHeader(
-//                    HTTPConstants.HEADER_CONTENT_TYPE,
-//                    "text/xml; charset=" + charEncoding);
-//
-//        }
-
         if (httpVersion != null) {
             if (httpVersion.equals(HTTPConstants.HEADER_PROTOCOL_10)) {
                 //postMethod.setHttp11(false); todo method to findout the transport version...

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java?rev=226984&r1=226983&r2=226984&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java Tue Aug  2 04:17:42 2005
@@ -48,6 +48,7 @@
 import org.apache.axis2.om.impl.llom.mtom.MTOMStAXSOAPModelBuilder;
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.SOAPFactory;
+import org.apache.axis2.soap.impl.llom.SOAPProcessingException;
 import org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder;
 import org.apache.axis2.soap.impl.llom.soap11.SOAP11Constants;
 import org.apache.axis2.soap.impl.llom.soap11.SOAP11Factory;
@@ -58,143 +59,187 @@
 public class HTTPTransportUtils {
 
     public static void processHTTPPostRequest(
-            MessageContext msgContext,
-            InputStream in,
-            OutputStream out,
-            String contentType,
-            String soapActionHeader,
-            String requestURI,
-            ConfigurationContext configurationContext)
-            throws AxisFault {
-            boolean soap11 = false;
-            try {
-                
-
-                //remove the starting and trailing " from the SOAP Action
-                if (soapActionHeader != null && soapActionHeader.startsWith("\"") && soapActionHeader.endsWith("\"")) {
+        MessageContext msgContext,
+        InputStream in,
+        OutputStream out,
+        String contentType,
+        String soapActionHeader,
+        String requestURI,
+        ConfigurationContext configurationContext)
+        throws AxisFault {
+        boolean soap11 = false;
+        try {
+
+            //remove the starting and trailing " from the SOAP Action
+            if (soapActionHeader != null
+                && soapActionHeader.startsWith("\"")
+                && soapActionHeader.endsWith("\"")) {
+
+                soapActionHeader =
+                    soapActionHeader.substring(
+                        1,
+                        soapActionHeader.length() - 1);
+            }
+            //fill up the Message Contexts
+            msgContext.setWSAAction(soapActionHeader);
+            msgContext.setSoapAction(soapActionHeader);
+            msgContext.setTo(new EndpointReference(requestURI));
+            msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
+            msgContext.setServerSide(true);
+
+            SOAPEnvelope envelope = null;
+            StAXBuilder builder = null;
+            if (contentType != null) {
+                if (contentType
+                    .indexOf(HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED)
+                    > -1) {
+                    //It is MTOM
+                    builder = selectBuilderForMIME(msgContext, in, contentType);
+                    envelope = (SOAPEnvelope) builder.getDocumentElement();
+                } else {
+                    Reader reader = new InputStreamReader(in);
 
-                    soapActionHeader = soapActionHeader.substring(1, soapActionHeader.length() - 1);
-                }
-                //fill up the Message Contexts
-                msgContext.setWSAAction(soapActionHeader);
-                msgContext.setSoapAction(soapActionHeader);
-                msgContext.setTo(new EndpointReference(requestURI));
-                msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
-                msgContext.setServerSide(true);
+                    XMLStreamReader xmlreader;
+                    //Figure out the char set encoding and create the reader
 
+                    //If charset is not specified
+                    if (contentType.indexOf(HTTPConstants.CHAR_SET_ENCODING)
+                        == -1) {
+                        xmlreader =
+                            XMLInputFactory
+                                .newInstance()
+                                .createXMLStreamReader(
+                                in,
+                                MessageContext.DEFAULT_CHAR_SET_ENCODING);
+                        //Set the encoding scheme in the message context
+                        msgContext.setProperty(
+                            MessageContext.CHARACTER_SET_ENCODING,
+                            MessageContext.DEFAULT_CHAR_SET_ENCODING);
+                    } else {
+                        //get the type of char encoding
+                        String charSetEnc = getCharSetEncoing(contentType);
+                        xmlreader =
+                            XMLInputFactory
+                                .newInstance()
+                                .createXMLStreamReader(
+                                in,
+                                charSetEnc);
+
+                        //Setting the value in msgCtx
+                        msgContext.setProperty(
+                            MessageContext.CHARACTER_SET_ENCODING,
+                            charSetEnc);
 
-                SOAPEnvelope envelope = null;
-                StAXBuilder builder = null;
-                if (contentType != null) {
-                    if (contentType.indexOf(HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED) > -1) {
-                        //It is MTOM
-                        builder = selectBuilderForMIME(msgContext, in, contentType);
+                    }
+                    if (contentType
+                        .indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE)
+                        > -1) {
+                        soap11 = false;
+                        //it is SOAP 1.2
+                        builder =
+                            new StAXSOAPModelBuilder(
+                                xmlreader,
+                                SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
                         envelope = (SOAPEnvelope) builder.getDocumentElement();
-                    } else {
-                        Reader reader = new InputStreamReader(in);
-                        
-                        XMLStreamReader xmlreader;
-                        //Figure out the char set encoding and create the reader
-                        
-                        //If charset is not specified
-                        if(contentType.indexOf(HTTPConstants.CHAR_SET_ENCODING) == -1) { 
-                        	xmlreader = XMLInputFactory
-								.newInstance()
-								.createXMLStreamReader(
-										in,
-										MessageContext.DEFAULT_CHAR_SET_ENCODING);
-                        	//Set the encoding scheme in the message context
-                        	msgContext.setProperty(
-								MessageContext.CHARACTER_SET_ENCODING,
-								MessageContext.DEFAULT_CHAR_SET_ENCODING);
+                    } else if (
+                        contentType.indexOf(
+                            SOAP11Constants.SOAP_11_CONTENT_TYPE)
+                            > -1) {
+                        soap11 = true;
+                        //it is SOAP 1.1
+                        Object enable =
+                            msgContext.getProperty(
+                                Constants.Configuration.ENABLE_REST);
+                        if ((soapActionHeader == null
+                            || soapActionHeader.length() == 0)
+                            && Constants.VALUE_TRUE.equals(enable)) {
+                            //If the content Type is text/xml (BTW which is the SOAP 1.1 Content type ) and
+                            //the SOAP Action is absent it is rest !!
+                            msgContext.setDoingREST(true);
+
+                            SOAPFactory soapFactory = new SOAP11Factory();
+                            builder = new StAXOMBuilder(xmlreader);
+                            builder.setOmbuilderFactory(soapFactory);
+                            envelope = soapFactory.getDefaultEnvelope();
+                            envelope.getBody().addChild(
+                                builder.getDocumentElement());
                         } else {
-                        	//get the type of char encoding
-                        	String charSetEnc = getCharSetEncoing(contentType);
-                        	xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in,charSetEnc);
-                        	
-                        	//Setting the value in msgCtx
-                        	msgContext.setProperty(MessageContext.CHARACTER_SET_ENCODING,charSetEnc);
-                        	
+                            builder =
+                                new StAXSOAPModelBuilder(
+                                    xmlreader,
+                                    SOAP11Constants
+                                        .SOAP_ENVELOPE_NAMESPACE_URI);
+                            envelope =
+                                (SOAPEnvelope) builder.getDocumentElement();
                         }
-                        if (contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
-                            soap11 = false;
-                            //it is SOAP 1.2
-                            builder = new StAXSOAPModelBuilder(xmlreader, SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-                            envelope = (SOAPEnvelope) builder.getDocumentElement();
-                        } else if (contentType.indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
-                            soap11 = true;
-                            //it is SOAP 1.1
-                            Object enable = msgContext.getProperty(Constants.Configuration.ENABLE_REST);
-                            if ((soapActionHeader == null || soapActionHeader.length() == 0)
-                                && Constants.VALUE_TRUE.equals(enable)) {
-                                //If the content Type is text/xml (BTW which is the SOAP 1.1 Content type ) and
-                                //the SOAP Action is absent it is rest !!
-                                msgContext.setDoingREST(true);
-
-                                SOAPFactory soapFactory = new SOAP11Factory();
-                                builder = new StAXOMBuilder(xmlreader);
-                                builder.setOmbuilderFactory(soapFactory);
-                                envelope = soapFactory.getDefaultEnvelope();
-                                envelope.getBody().addChild(builder.getDocumentElement());
-                            }else{
-                                builder = new StAXSOAPModelBuilder(xmlreader, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-                                envelope = (SOAPEnvelope) builder.getDocumentElement();
-                            }
-                        }
-
                     }
 
                 }
 
-                msgContext.setEnvelope(envelope);
-                AxisEngine engine = new AxisEngine(configurationContext);
-                if (envelope.getBody().hasFault()) {
-                    engine.receiveFault(msgContext);
-                } else {
-                    engine.receive(msgContext);
-                }
+            }
+
+            msgContext.setEnvelope(envelope);
+            AxisEngine engine = new AxisEngine(configurationContext);
+            if (envelope.getBody().hasFault()) {
+                engine.receiveFault(msgContext);
+            } else {
+                engine.receive(msgContext);
+            }
+        } catch (SOAPProcessingException e) {
+            throw new AxisFault(e);
+
+        } catch (AxisFault e) {
+            throw new AxisFault(e);
+        } catch (OMException e) {
+            throw new AxisFault(e);
+        } catch (XMLStreamException e) {
+            throw new AxisFault(e);
+        } catch (FactoryConfigurationError e) {
+            throw new AxisFault(e);
+
+        } finally {
+            if (msgContext.getEnvelope() == null && !soap11) {
+                msgContext.setEnvelope(
+                    new SOAP12Factory().createSOAPEnvelope());
+            }
 
-            } catch (Exception e){
-                if(msgContext.getEnvelope() == null && !soap11){
-                    msgContext.setEnvelope(new SOAP12Factory().createSOAPEnvelope());
-                }
-                throw new AxisFault(e);
-            } 
         }
+    }
 
-    
     /**
      * Extracts and returns the character set encoding from the 
      * Content-type header
      * Example:
      * Content-Type: text/xml; charset=utf-8 
-	 * @param contentType
-	 */
-	private static String getCharSetEncoing(String contentType) {
-		int index = contentType.indexOf(HTTPConstants.CHAR_SET_ENCODING);
-		//If there are spaces around the '=' sign
-		int indexOfEq = contentType.indexOf("=", index);
-		String value = (contentType.substring(indexOfEq + 1, contentType
-				.length())).trim();
-
-		//There might be "" around the value - if so remove them
-		value = value.replaceAll("\"", "");
-
-		return value.trim();
-		
-	}
-
-    
-    public static boolean processHTTPGetRequest(MessageContext msgContext,
-                                                InputStream in,
-                                                OutputStream out,
-                                                String contentType,
-                                                String soapAction,
-                                                String requestURI,
-                                                ConfigurationContext configurationContext,
-                                                Map requestParameters)
-            throws AxisFault {
-        if (soapAction != null && soapAction.startsWith("\"") && soapAction.endsWith("\"")) {
+     * @param contentType
+     */
+    private static String getCharSetEncoing(String contentType) {
+        int index = contentType.indexOf(HTTPConstants.CHAR_SET_ENCODING);
+        //If there are spaces around the '=' sign
+        int indexOfEq = contentType.indexOf("=", index);
+        String value =
+            (contentType.substring(indexOfEq + 1, contentType.length())).trim();
+
+        //There might be "" around the value - if so remove them
+        value = value.replaceAll("\"", "");
+
+        return value.trim();
+
+    }
+
+    public static boolean processHTTPGetRequest(
+        MessageContext msgContext,
+        InputStream in,
+        OutputStream out,
+        String contentType,
+        String soapAction,
+        String requestURI,
+        ConfigurationContext configurationContext,
+        Map requestParameters)
+        throws AxisFault {
+        if (soapAction != null
+            && soapAction.startsWith("\"")
+            && soapAction.endsWith("\"")) {
             soapAction = soapAction.substring(1, soapAction.length() - 1);
         }
         msgContext.setWSAAction(soapAction);
@@ -203,7 +248,9 @@
         msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
         msgContext.setServerSide(true);
         SOAPEnvelope envelope =
-                HTTPTransportUtils.createEnvelopeFromGetRequest(requestURI, requestParameters);
+            HTTPTransportUtils.createEnvelopeFromGetRequest(
+                requestURI,
+                requestParameters);
         if (envelope == null) {
             return false;
         } else {
@@ -215,15 +262,19 @@
         }
     }
 
-    public static final SOAPEnvelope createEnvelopeFromGetRequest(String requestUrl, Map map) {
-        String[] values = Utils.parseRequestURLForServiceAndOperation(requestUrl);
+    public static final SOAPEnvelope createEnvelopeFromGetRequest(
+        String requestUrl,
+        Map map) {
+        String[] values =
+            Utils.parseRequestURLForServiceAndOperation(requestUrl);
 
         if (values[1] != null && values[0] != null) {
             String operation = values[1];
             SOAPFactory soapFactory = new SOAP11Factory();
             SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
 
-            OMNamespace omNs = soapFactory.createOMNamespace(values[0], "services");
+            OMNamespace omNs =
+                soapFactory.createOMNamespace(values[0], "services");
             OMNamespace defualtNs = new OMNamespaceImpl("", null);
 
             OMElement opElement = soapFactory.createOMElement(operation, omNs);
@@ -244,26 +295,37 @@
         }
     }
 
-    public static StAXBuilder selectBuilderForMIME(MessageContext msgContext,
-                                                   InputStream inStream,
-                                                   String contentTypeString)
-            throws OMException, XMLStreamException, FactoryConfigurationError {
+    public static StAXBuilder selectBuilderForMIME(
+        MessageContext msgContext,
+        InputStream inStream,
+        String contentTypeString)
+        throws OMException, XMLStreamException, FactoryConfigurationError {
         StAXBuilder builder = null;
 
         boolean fileCacheForAttachments =
-                (Constants
+            (Constants
                 .VALUE_TRUE
-                .equals(msgContext.getProperty(Constants.Configuration.CACHE_ATTACHMENTS)));
+                .equals(
+                    msgContext.getProperty(
+                        Constants.Configuration.CACHE_ATTACHMENTS)));
         String attachmentRepoDir = null;
         if (fileCacheForAttachments) {
             attachmentRepoDir =
-                    (String) msgContext.getProperty(Constants.Configuration.ATTACHMENT_TEMP_DIR);
+                (String) msgContext.getProperty(
+                    Constants.Configuration.ATTACHMENT_TEMP_DIR);
         }
 
         MIMEHelper mimeHelper =
-                new MIMEHelper(inStream, contentTypeString, fileCacheForAttachments, attachmentRepoDir);
+            new MIMEHelper(
+                inStream,
+                contentTypeString,
+                fileCacheForAttachments,
+                attachmentRepoDir);
         XMLStreamReader reader =
-                XMLInputFactory.newInstance().createXMLStreamReader(new BufferedReader(new InputStreamReader(mimeHelper.getSOAPPartInputStream())));
+            XMLInputFactory.newInstance().createXMLStreamReader(
+                new BufferedReader(
+                    new InputStreamReader(
+                        mimeHelper.getSOAPPartInputStream())));
 
         /*
          * put a reference to Attachments in to the message context
@@ -273,9 +335,17 @@
             /*
              * Creates the MTOM specific MTOMStAXSOAPModelBuilder
              */
-            builder = new MTOMStAXSOAPModelBuilder(reader, mimeHelper, SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-        } else if (mimeHelper.getAttachmentSpecType().equals(MIMEHelper.SWA_TYPE)) {
-            builder = new StAXSOAPModelBuilder(reader, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+            builder =
+                new MTOMStAXSOAPModelBuilder(
+                    reader,
+                    mimeHelper,
+                    SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+        } else if (
+            mimeHelper.getAttachmentSpecType().equals(MIMEHelper.SWA_TYPE)) {
+            builder =
+                new StAXSOAPModelBuilder(
+                    reader,
+                    SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
         }
         return builder;
     }
@@ -289,7 +359,8 @@
         boolean isOptimized = false;
         while (childrenIter.hasNext() && !isOptimized) {
             OMNode node = (OMNode) childrenIter.next();
-            if (OMNode.TEXT_NODE == node.getType() && ((OMText) node).isOptimized()) {
+            if (OMNode.TEXT_NODE == node.getType()
+                && ((OMText) node).isOptimized()) {
                 isOptimized = true;
             } else if (OMNode.ELEMENT_NODE == node.getType()) {
                 isOptimized = isOptimised((OMElement) node);
@@ -300,12 +371,16 @@
 
     public static boolean doWriteMTOM(MessageContext msgContext) {
         boolean enableMTOM = false;
-        if (msgContext.getProperty(Constants.Configuration.ENABLE_MTOM) != null) {
+        if (msgContext.getProperty(Constants.Configuration.ENABLE_MTOM)
+            != null) {
             enableMTOM =
-                    Constants.VALUE_TRUE.equals(msgContext.getProperty(Constants.Configuration.ENABLE_MTOM));
+                Constants.VALUE_TRUE.equals(
+                    msgContext.getProperty(
+                        Constants.Configuration.ENABLE_MTOM));
         }
         boolean envelopeContainsOptimise =
-                HTTPTransportUtils.checkEnvelopeForOptimise(msgContext.getEnvelope());
+            HTTPTransportUtils.checkEnvelopeForOptimise(
+                msgContext.getEnvelope());
         boolean doMTOM = enableMTOM && envelopeContainsOptimise;
         msgContext.setDoingMTOM(doMTOM);
         return doMTOM;

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java?rev=226984&r1=226983&r2=226984&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java Tue Aug  2 04:17:42 2005
@@ -72,14 +72,25 @@
                 Map map = receiver.parseTheHeaders(inStream, true);
 
                 //build a way to write the respone if the Axis choose to do so
-
+                String httpVersion = (String)map.get(HTTPConstants.PROTOCOL_VERSION);
+                if(httpVersion == null){
+                    throw new AxisFault("HTTP version can not be Null");
+                }
+                if(HTTPConstants.HEADER_PROTOCOL_10.equals(httpVersion)){
+                    httpVersion = HTTPConstants.HEADER_PROTOCOL_10;
+                }else if(HTTPConstants.HEADER_PROTOCOL_11.equals(httpVersion)){
+                    httpVersion = HTTPConstants.HEADER_PROTOCOL_11;
+                }else{
+                    throw new AxisFault("Unknown protocol versoin "+ httpVersion);
+                }
+                
                 String transferEncoding = (String) map.get(HTTPConstants.HEADER_TRANSFER_ENCODING);
                 if (transferEncoding != null
                     && HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED.equals(transferEncoding)) {
                     inStream = new ChunkedInputStream(inStream);
-                    out = new SimpleHTTPOutputStream(socket.getOutputStream(), true);
+                    out = new SimpleHTTPOutputStream(socket.getOutputStream(), true,httpVersion);
                 } else {
-                    out = new SimpleHTTPOutputStream(socket.getOutputStream(), false);
+                    out = new SimpleHTTPOutputStream(socket.getOutputStream(), false,httpVersion);
                 }
                 msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
                 //set the transport Headers
@@ -139,7 +150,7 @@
                 log.error(e1);
                 e1.printStackTrace();
             }
-            //e.printStackTrace();
+            e.printStackTrace();
         } finally {
             if (socket != null) {
                 try {

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/SimpleHTTPOutputStream.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/SimpleHTTPOutputStream.java?rev=226984&r1=226983&r2=226984&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/SimpleHTTPOutputStream.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/SimpleHTTPOutputStream.java Tue Aug  2 04:17:42 2005
@@ -27,11 +27,13 @@
     private boolean written = false;
     private boolean chuncked = false;
     private String contentType = null;
+    private String httpVersion;
 
-    public SimpleHTTPOutputStream(OutputStream out, boolean chuncked)
-            throws AxisFault {
+    public SimpleHTTPOutputStream(OutputStream out, boolean chuncked,String httpVersion)
+        throws AxisFault {
         super(out);
         this.chuncked = chuncked;
+        this.httpVersion = httpVersion;
     }
 
     public void write(byte[] b) throws IOException {
@@ -68,12 +70,12 @@
     public void writeHeader() throws IOException {
         StringBuffer buf = new StringBuffer();
         if (chuncked) {
-            buf.append(new String(HTTPConstants.HEADER_PROTOCOL_11)).append(
-                    " ");
+            buf.append(httpVersion).append(
+                " ");
             buf.append(new String(HTTPConstants.OK)).append("\n");
             buf.append(HTTPConstants.HEADER_TRANSFER_ENCODING).append(": ");
             buf.append(HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED).append(
-                    "\n");
+                "\n");
             if (contentType != null) {
                 buf.append(HTTPConstants.HEADER_CONTENT_TYPE).append(": ");
                 buf.append(contentType).append("\n");
@@ -99,7 +101,11 @@
 
     public void finalize() throws IOException {
         if (!written) {
-            out.write(new String(HTTPConstants.NOCONTENT).getBytes());
+            StringBuffer buf = new StringBuffer();
+            buf.append(httpVersion).append(
+                " ");
+            buf.append(new String(HTTPConstants.NOCONTENT));
+            out.write(buf.toString().getBytes());
             written = true;
         } else {
             out.flush();

Modified: webservices/axis/trunk/java/modules/samples/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/project.xml?rev=226984&r1=226983&r2=226984&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/project.xml (original)
+++ webservices/axis/trunk/java/modules/samples/project.xml Tue Aug  2 04:17:42 2005
@@ -166,14 +166,18 @@
                 <exclude>**/*InteropStubTest.java</exclude>
                 <exclude>**/*EchoRawXMLChunckedTest.java</exclude>
                 <exclude>**org/apache/axis2/mail/*.java</exclude>
+                 
+                
                 
-                <exclude>**/OneWayRawXMLTest.java</exclude>
                 <!--
                 <exclude>**/*EchoRawMTOMTest.java</exclude>
                 <exclude>**/*EchoRawMTOMLoadTest.java</exclude>
                 <exclude>**/*EchoRawMTOMToBase64Test.java</exclude>
                 
-                <exclude>**/*MTOMCommonsChunkingTest.java</exclude> -->
+                <exclude>**/*MTOMCommonsChunkingTest.java</exclude> 
+                <exclude>**/OneWayRawXMLTest.java</exclude>
+               
+                -->
          
                 <!--
          		<exclude>**/*SOAP12Test.java</exclude>