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 2004/12/09 10:57:08 UTC

svn commit: r111371 - in webservices/axis/trunk/java/dev/scratch/prototype2: . src/java/org/apache/axis/client src/java/org/apache/axis/engine src/java/org/apache/axis/impl/providers src/java/org/apache/axis/impl/transport src/java/org/apache/axis/impl/transport/http src/java/org/apache/axis/impl/transport/tcp src/test/org/apache/axis/engine

Author: hemapani
Date: Thu Dec  9 01:57:07 2004
New Revision: 111371

URL: http://svn.apache.org/viewcvs?view=rev&rev=111371
Log:
refactor the recivers
Added:
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/AbstractTransportReceiver.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/AbstractTrasnportSender.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPReceiver.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportReceiver.java
Removed:
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/ServerHttpHandler.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleAxisServer.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPHandler.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportRecvier.java
Modified:
   webservices/axis/trunk/java/dev/scratch/prototype2/project.xml
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/AbstractProvider.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/SimpleJavaProvider.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/HTTPTrasnportSender.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTrasnportSender.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoTest.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/SimpleAxisServerTest.java

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/project.xml
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/project.xml?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/project.xml&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/project.xml&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/project.xml	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/project.xml	Thu Dec  9 01:57:07 2004
@@ -65,13 +65,14 @@
       <email>hemapani@apache.org</email>
       <organization></organization>
     </developer>
-<developer>
+	<developer>
       <name>Ajith Ranabahu</name>
       <id>ajith</id>
       <email>ajith@apache.org</email>
       <organization>LSF</organization>
     </developer>
-    <name>Deepal Jayasinghe</name>
+    <developer>
+	  <name>Deepal Jayasinghe</name>
       <id>deepal</id>
       <email>deepal@apache.org</email>
       <organization>LSF</organization>

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/client/Call.java	Thu Dec  9 01:57:07 2004
@@ -15,7 +15,6 @@
  */
 package org.apache.axis.client;
 
-import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -182,10 +181,7 @@
         try {
             msgContext = new MessageContext(engine.getRegistry());
             msgContext.setServerSide(true);
-
-            String methodName = null;
-            
-            //TODO Thanks our URL we need nothng here .. may be need parsing code 
+            //TODO Thanks to the URL we need nothng here .. may be need parsing code 
 //      int level = 0;
 //      while(level != 2){
 //          byte b = (byte)inp.read();
@@ -202,13 +198,9 @@
 //
 //      }
             InputStreamReader isr = new InputStreamReader(in);
-            BufferedReader bufR = new BufferedReader(isr);
             XMLStreamReader reader =  XMLInputFactory.newInstance().createXMLStreamReader(isr);
-
             StAXBuilder builder = new StAXSOAPModelBuilder(OMFactory.newInstance(),reader);
             msgContext.setEnvelope((SOAPEnvelope)builder.getDocumentElement());
-              
-            EngineRegistry reg = engine.getRegistry();
         } catch (XMLStreamException e) {
             throw AxisFault.makeFault(e);
         } 

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/engine/AxisEngine.java	Thu Dec  9 01:57:07 2004
@@ -42,7 +42,6 @@
     }
 
     public void send(MessageContext mc)throws AxisFault{
-        QName currentServiceName = null;
         Service service = null;
         //dispatch the service Name
         service = mc.getService();

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/AbstractProvider.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/AbstractProvider.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/AbstractProvider.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/AbstractProvider.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/AbstractProvider.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/AbstractProvider.java	Thu Dec  9 01:57:07 2004
@@ -27,7 +27,6 @@
  */
 public abstract class AbstractProvider extends AbstractEngineElement implements Provider{
     private QName name;
-    private String scope;
     public QName getName() {
         return name;
     }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/SimpleJavaProvider.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/SimpleJavaProvider.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/SimpleJavaProvider.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/SimpleJavaProvider.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/SimpleJavaProvider.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/providers/SimpleJavaProvider.java	Thu Dec  9 01:57:07 2004
@@ -39,7 +39,6 @@
 
 public class SimpleJavaProvider extends AbstractProvider implements Provider {
     protected Log log = LogFactory.getLog(getClass());
-    private String message;
     private QName name;
     private String scope;
     private Method method;

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/AbstractTransportReceiver.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/AbstractTransportReceiver.java?view=auto&rev=111371
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/AbstractTransportReceiver.java	Thu Dec  9 01:57:07 2004
@@ -0,0 +1,177 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.impl.transport;
+
+
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisEngine;
+import org.apache.axis.engine.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.ServerSocket;
+
+import java.net.Socket;
+
+/**
+ * This is a simple implementation of an HTTP server for processing
+ * SOAP requests via Apache's xml-axis.  This is not intended for production
+ * use.  Its intended uses are for demos, debugging, and performance
+ * profiling.
+ *
+ * Note this classes uses static objects to provide a thread pool, so you should
+ * not use multiple instances of this class in the same JVM/classloader unless
+ * you want bad things to happen at shutdown.
+ * @author Sam Ruby (ruby@us.ibm.com)
+ * @author Rob Jellinghaus (robj@unrealities.com)
+ * @author Alireza Taherkordi (a_taherkordi@users.sourceforge.net)
+ */
+public abstract class AbstractTransportReceiver implements Runnable {
+    protected Log log =
+            LogFactory.getLog(AbstractTransportReceiver.class.getName());
+    protected AxisEngine engine = null;
+    protected ServerSocket serverSocket;  
+    protected Socket socket = null;  
+    /**
+    are we stopped?
+    latch to true if stop() is called
+     */
+    private boolean stopped = false;
+    
+
+    public AbstractTransportReceiver(AxisEngine myAxisServer) {
+    	this.engine = myAxisServer;
+		
+    }
+
+    /**
+     * stop the server if not already told to.
+     * @throws Throwable
+     */
+    protected void finalize() throws Throwable {
+        stop();
+        super.finalize();
+    }
+
+    /**
+     * Accept requests from a given TCP port and send them through the
+     * Axis engine for processing.
+     */
+    public void run() {
+        try{
+            try {
+                // Accept and process requests from the socket
+                while (!stopped) {
+                    try {
+                        this.socket = serverSocket.accept();
+                       
+                    } catch (java.io.InterruptedIOException iie) {
+                    } catch (Exception e) {
+                        log.debug(e.getMessage(), e);
+                        break;
+                    }
+                    if (socket != null) {
+                        MessageContext msgContext = parseTheTransport(engine,socket.getInputStream());
+                        storeOutputInfo(msgContext,socket.getOutputStream());
+                        engine.recive(msgContext);
+                        this.socket.close();
+                        this.socket = null;
+                    }
+                }
+            } catch (AxisFault e) {
+                log.error(e);
+                this.socket.close();
+                this.socket = null;
+            }     
+        }catch (IOException e) {
+            log.error(e);
+        }
+        stop();
+        log.info("Simple Axis Server Quit");
+    }
+
+
+    /**
+     * Obtain the serverSocket that that SimpleAxisServer is listening on.
+     */
+    public ServerSocket getServerSocket() {
+        return serverSocket;
+    }
+
+    /**
+     * Set the serverSocket this server should listen on.
+     * (note : changing this will not affect a running server, but if you
+     *  stop() and then start() the server, the new socket will be used).
+     */
+    public void setServerSocket(ServerSocket serverSocket) {
+        this.serverSocket = serverSocket;
+    }
+
+
+    /**
+     * Start this server as a NON-daemon.
+     */
+    public void start() throws Exception {
+    	run();
+    }
+
+    /**
+     * Stop this server. Can be called safely if the system is already stopped,
+     * or if it was never started.
+     *
+     * This will interrupt any pending accept().
+     */
+    public void stop() {
+        log.info("stop called");
+        //recognise use before we are live
+        if(stopped ) {
+            return;
+        }
+        /*
+         * Close the server socket cleanly, but avoid fresh accepts while
+         * the socket is closing.
+         */
+        stopped = true;
+
+        try {
+            if(serverSocket != null) {
+                serverSocket.close();
+//                while(socket != null){
+//                    try {
+//                        //make sure all sockets closed by the time 
+//                        //else we got in to lot of trouble testing
+//                        Thread.sleep(1000);
+//                    } catch (InterruptedException e1) {
+//                        log.error(e1);
+//                    }
+//                }
+            }
+        } catch (IOException e) {
+            log.info(e);
+        } finally {
+            serverSocket=null;
+        }
+        log.info("Simple Axis Server Quits");
+    }
+    
+    protected abstract MessageContext parseTheTransport(AxisEngine engine, InputStream in)throws AxisFault;
+    protected abstract void storeOutputInfo(MessageContext msgctx, OutputStream out)throws AxisFault;
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/AbstractTrasnportSender.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/AbstractTrasnportSender.java?view=auto&rev=111371
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/AbstractTrasnportSender.java	Thu Dec  9 01:57:07 2004
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.impl.transport;
+
+import java.io.OutputStream;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.EndpointReferance;
+import org.apache.axis.engine.TransportSender;
+import org.apache.axis.impl.handlers.AbstractHandler;
+import org.apache.axis.impl.llom.serialize.SimpleOMSerializer;
+import org.apache.axis.om.SOAPEnvelope;
+
+/**
+ * @author Srinath Perera(hemapani@opensource.lk)
+ */
+public abstract class AbstractTrasnportSender extends AbstractHandler implements TransportSender{
+    public final void invoke(MessageContext msgContext) throws AxisFault {
+        OutputStream out = null;
+        if(msgContext.isProcessingFault()){
+            //Means we are processing fault
+            if(msgContext.getFaultTo()!= null){
+                out = obtainOutPutStream(msgContext,msgContext.getFaultTo());
+            }else{
+                out = obtainOutPutStream(msgContext);
+            }
+        }else{
+            if(msgContext.getTo()!= null){
+                out = obtainOutPutStream(msgContext,msgContext.getTo());
+            }else if(msgContext.getReplyTo() != null){
+                out = obtainOutPutStream(msgContext,msgContext.getTo());
+            }else{
+                out = obtainOutPutStream(msgContext);
+            }
+        }
+        startSending();
+        SOAPEnvelope envelope = msgContext.getEnvelope();
+        if(envelope != null){
+            SimpleOMSerializer serializer = new SimpleOMSerializer();
+            serializer.serialize(envelope,out);
+            
+        }
+        finalizeSending();
+    }
+    protected void startSending(){}
+    protected abstract OutputStream obtainOutPutStream(MessageContext msgContext,EndpointReferance epr) throws AxisFault;
+    protected abstract OutputStream obtainOutPutStream(MessageContext msgContext) throws AxisFault;
+    protected void finalizeSending(){}
+}

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/HTTPTrasnportSender.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/HTTPTrasnportSender.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/HTTPTrasnportSender.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/HTTPTrasnportSender.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/HTTPTrasnportSender.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/HTTPTrasnportSender.java	Thu Dec  9 01:57:07 2004
@@ -18,65 +18,51 @@
 
 import org.apache.axis.context.MessageContext;
 import org.apache.axis.engine.AxisFault;
-import org.apache.axis.engine.TransportSender;
-import org.apache.axis.impl.handlers.AbstractHandler;
-import org.apache.axis.impl.llom.serialize.SimpleOMSerializer;
-import org.apache.axis.om.SOAPEnvelope;
+import org.apache.axis.engine.EndpointReferance;
+import org.apache.axis.impl.transport.AbstractTrasnportSender;
 
 import java.io.OutputStream;
 
 /**
  * @author Srinath Perera(hemapani@opensource.lk)
  */
-public class HTTPTrasnportSender extends AbstractHandler implements TransportSender{
+public class HTTPTrasnportSender extends AbstractTrasnportSender{
     protected OutputStream out;
     
     public HTTPTrasnportSender(OutputStream out){
         this.out = out;
     }
     
-    public void invoke(MessageContext msgContext) throws AxisFault {
-        OutputStream out = null;
-        if(msgContext.isProcessingFault()){
-            //Means we are processing fault
-            if(msgContext.getFaultTo()!= null){
-                throw new UnsupportedOperationException("Addressing not suppotrted yet");
-            }else{
-                out = (OutputStream)msgContext.getProperty(MessageContext.TRANSPORT_DATA);
-            }
+    protected OutputStream obtainOutPutStream(MessageContext msgContext) throws AxisFault {
+        OutputStream out = (OutputStream)msgContext.getProperty(MessageContext.TRANSPORT_DATA);
+        if(out == null){
+            throw new AxisFault("can not find the suffient information to find endpoint");
         }else{
-            if(msgContext.getTo()!= null){
-                throw new UnsupportedOperationException("Addressing not suppotrted yet");
-            }else if(msgContext.getReplyTo() != null){
-                throw new UnsupportedOperationException("Addressing not suppotrted yet");
-            }else{
-                out = (OutputStream)msgContext.getProperty(MessageContext.TRANSPORT_DATA);
-            }
-        }
-        
-//            if(!msgContext.isServerSide()){
-//                URL url = (URL)msgContext.getProperty(MessageContext.REQUEST_URL);
-//                if(url != null){
-//                    StringBuffer buf = new StringBuffer();
-//                    buf.append("POST ").append(url.getFile()).append("HTTP/1.1\n");
-//                    buf.append("Host: ").append(url.getHost());
-//                    buf.append("Content-Type: application/soap+xml; charset=\"utf-8\"\n");
-//                    out.write(buf.toString().getBytes());
-//                }else{
-//                    throw new AxisFault(MessageContext.REQUEST_URL + "where to send ?");
-//                }
-//            }
-        
-        SOAPEnvelope envelope = msgContext.getEnvelope();
-        if(envelope != null){
-            SimpleOMSerializer serializer = new SimpleOMSerializer();
-            serializer.serialize(envelope,this.out);
-            
+            return out;
         }
+
     }
 
-    public void revoke(MessageContext msgContext) {
+    protected OutputStream obtainOutPutStream(MessageContext msgContext,EndpointReferance epr) {
+        throw new UnsupportedOperationException("Addressing not suppotrted yet");
+    }
+
+    protected void finalizeSending() {
+    }
 
+    protected void startSending() {
+//      if(!msgContext.isServerSide()){
+//          URL url = (URL)msgContext.getProperty(MessageContext.REQUEST_URL);
+//          if(url != null){
+//              StringBuffer buf = new StringBuffer();
+//              buf.append("POST ").append(url.getFile()).append("HTTP/1.1\n");
+//              buf.append("Host: ").append(url.getHost());
+//              buf.append("Content-Type: application/soap+xml; charset=\"utf-8\"\n");
+//              out.write(buf.toString().getBytes());
+//          }else{
+//              throw new AxisFault(MessageContext.REQUEST_URL + "where to send ?");
+//          }
+//      }
     }
 
 }

Deleted: /webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/ServerHttpHandler.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/ServerHttpHandler.java?view=auto&rev=111370
==============================================================================

Deleted: /webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleAxisServer.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleAxisServer.java?view=auto&rev=111370
==============================================================================

Deleted: /webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPHandler.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPHandler.java?view=auto&rev=111370
==============================================================================

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPReceiver.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPReceiver.java?view=auto&rev=111371
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPReceiver.java	Thu Dec  9 01:57:07 2004
@@ -0,0 +1,496 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis.impl.transport.http;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisEngine;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.TransportSenderLocator;
+import org.apache.axis.impl.llom.builder.StAXBuilder;
+import org.apache.axis.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis.impl.transport.AbstractTransportReceiver;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.SOAPEnvelope;
+import org.apache.axis.registry.EngineRegistry;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
+
+public class SimpleHTTPReceiver extends AbstractTransportReceiver implements Runnable {
+    protected static Log log =
+            LogFactory.getLog(SimpleHTTPReceiver.class.getName());
+
+    // Axis specific constants
+    protected static String transportName = "SimpleHTTP";
+    protected AxisEngine engine;
+  //  private SimpleAxisServer server;
+   // private Socket socket;
+    
+
+    // HTTP status codes
+    protected static byte OK[] = ("200 OK").getBytes();
+    protected static byte NOCONTENT[] = ("202 OK\n\n").getBytes();
+    protected static byte UNAUTH[] = ("401 Unauthorized").getBytes();
+    protected static byte SENDER[] = "400".getBytes();
+    protected static byte ISE[] = ("500 Internal server error").getBytes();
+
+    // HTTP prefix
+    protected static byte HTTP[] = "HTTP/1.0 ".getBytes();
+
+    // Standard MIME headers for XML payload
+    protected static byte XML_MIME_STUFF[] =
+            ("\r\nContent-Type: text/xml; charset=utf-8\r\n" +
+            "Content-Length: ").getBytes();
+
+    // Standard MIME headers for HTML payload
+    protected static byte HTML_MIME_STUFF[] =
+            ("\r\nContent-Type: text/html; charset=utf-8\r\n" +
+            "Content-Length: ").getBytes();
+
+    // Mime/Content separator
+    protected static byte SEPARATOR[] = "\r\n\r\n".getBytes();
+
+    // Tiddly little response
+//    protected static final String responseStr =
+//            "<html><head><title>SimpleAxisServer</title></head>" +
+//            "<body><h1>SimpleAxisServer</h1>" +
+//            Messages.getEnvelope("reachedServer00") +
+//            "</html>";
+//    protected static byte cannedHTMLResponse[] = responseStr.getBytes();
+
+    // ASCII character mapping to lower case
+    protected static final byte[] toLower = new byte[256];
+
+    static {
+        for (int i = 0; i < 256; i++) {
+            toLower[i] = (byte) i;
+        }
+
+        for (int lc = 'a'; lc <= 'z'; lc++) {
+            toLower[lc + 'A' - 'a'] = (byte) lc;
+        }
+    }
+
+    // buffer for IO
+    protected static final int BUFSIZ = 4096;
+
+    // mime header for content length
+    protected static final byte lenHeader[] = "content-length: ".getBytes();
+    protected static final int lenLen = lenHeader.length;
+
+    // mime header for content type
+    protected static final byte typeHeader[] = (HTTPConstants.HEADER_CONTENT_TYPE.toLowerCase() + ": ").getBytes();
+    protected static final int typeLen = typeHeader.length;
+
+    // mime header for content location
+    protected static final byte locationHeader[] = (HTTPConstants.HEADER_CONTENT_LOCATION.toLowerCase() + ": ").getBytes();
+    protected static final int locationLen = locationHeader.length;
+
+    // mime header for soap action
+    protected static final byte actionHeader[] = "soapaction: ".getBytes();
+    protected static final int actionLen = actionHeader.length;
+
+    // mime header for cookie
+    protected static final byte cookieHeader[] = "cookie: ".getBytes();
+    protected static final int cookieLen = cookieHeader.length;
+
+    // mime header for cookie2
+    protected static final byte cookie2Header[] = "cookie2: ".getBytes();
+    protected static final int cookie2Len = cookie2Header.length;
+
+    // HTTP header for authentication
+    protected static final byte authHeader[] = "authorization: ".getBytes();
+    protected static final int authLen = authHeader.length;
+
+    // mime header for GET
+    protected static final byte getHeader[] = "GET".getBytes();
+
+    // mime header for POST
+    protected static final byte postHeader[] = "POST".getBytes();
+
+    // header ender
+    protected static final byte headerEnder[] = ": ".getBytes();
+
+    // "Basic" auth string
+    protected static final byte basicAuth[] = "basic ".getBytes();
+
+
+    
+    /**
+     * @param myAxisServer
+     */
+    public SimpleHTTPReceiver(AxisEngine myAxisServer) {
+        super(myAxisServer);
+    }
+
+    /**
+     * The main workhorse method.
+     */
+
+    protected void invokeMethodFromGet(String methodName, String args) throws Exception {
+
+    }
+
+    /**
+     * Read all mime headers, returning the value of Content-Length and
+     * SOAPAction.
+     * @param is         InputStream to read from
+     * @param contentType The content type.
+     * @param contentLocation The content location
+     * @param soapAction StringBuffer to return the soapAction into
+     * @param httpRequest StringBuffer for GET / POST
+     * @param cookie first cookie header (if doSessions)
+     * @param cookie2 second cookie header (if doSessions)
+     * @param headers HTTP headers to transfer to MIME headers
+     * @return Content-Length
+     */
+    protected int parseHeaders(NonBlockingBufferedInputStream is,
+                             byte buf[],
+                             StringBuffer contentType,
+                             StringBuffer contentLocation,
+                             StringBuffer soapAction,
+                             StringBuffer httpRequest,
+                             StringBuffer fileName,
+                             StringBuffer cookie,
+                             StringBuffer cookie2,
+                             StringBuffer authInfo)
+//                             MimeHeaders headers)
+            throws java.io.IOException {
+        int n;
+        int len = 0;
+
+        // parse first line as GET or POST
+        n = this.readLine(is, buf, 0, buf.length);
+        if (n < 0) {
+            // nothing!
+            throw new java.io.IOException("Unexpected end of stream");
+        }
+
+        // which does it begin with?
+        httpRequest.delete(0, httpRequest.length());
+        fileName.delete(0, fileName.length());
+        contentType.delete(0, contentType.length());
+        contentLocation.delete(0, contentLocation.length());
+
+        if (buf[0] == getHeader[0]) {
+            httpRequest.append("GET");
+            for (int i = 0; i < n - 5; i++) {
+                char c = (char) (buf[i + 5] & 0x7f);
+                if (c == ' ')
+                    break;
+                fileName.append(c);
+            }
+            return 0;
+        } else if (buf[0] == postHeader[0]) {
+            httpRequest.append("POST");
+            for (int i = 0; i < n - 6; i++) {
+                char c = (char) (buf[i + 6] & 0x7f);
+                if (c == ' ')
+                    break;
+                fileName.append(c);
+            }
+        } else {
+            throw new java.io.IOException("Cannot handle non-GET, non-POST request");
+        }
+
+        while ((n = readLine(is, buf, 0, buf.length)) > 0) {
+
+            if ((n <= 2) && (buf[0] == '\n' || buf[0] == '\r') && (len > 0)) break;
+
+            // RobJ gutted the previous logic; it was too hard to extend for more headers.
+            // Now, all it does is search forwards for ": " in the buf,
+            // then do a length / byte compare.
+            // Hopefully this is still somewhat efficient (Sam is watching!).
+
+            // First, search forwards for ": "
+            int endHeaderIndex = 0;
+            while (endHeaderIndex < n && toLower[buf[endHeaderIndex]] != headerEnder[0]) {
+                endHeaderIndex++;
+            }
+            endHeaderIndex += 2;
+            // endHeaderIndex now points _just past_ the ": ", and is
+            // comparable to the various lenLen, actionLen, etc. values
+
+            // convenience; i gets pre-incremented, so initialize it to one less
+            int i = endHeaderIndex - 1;
+
+            // which header did we find?
+            if (endHeaderIndex == lenLen && matches(buf, lenHeader)) {
+                // parse content length
+
+                while ((++i < n) && (buf[i] >= '0') && (buf[i] <= '9')) {
+                    len = (len * 10) + (buf[i] - '0');
+                }
+//                headers.addHeader(HTTPConstants.HEADER_CONTENT_LENGTH, String.valueOf(len));
+
+            } else if (endHeaderIndex == actionLen
+                    && matches(buf, actionHeader)) {
+
+                soapAction.delete(0, soapAction.length());
+                // skip initial '"'
+                i++;
+                while ((++i < n) && (buf[i] != '"')) {
+                    soapAction.append((char) (buf[i] & 0x7f));
+                }
+//                headers.addHeader(HTTPConstants.HEADER_SOAP_ACTION, "\"" + soapAction.toString() + "\"");
+
+            } else if (endHeaderIndex == authLen && matches(buf, authHeader)) {
+                if (matches(buf, endHeaderIndex, basicAuth)) {
+                    i += basicAuth.length;
+                    while (++i < n && (buf[i] != '\r') && (buf[i] != '\n')) {
+                        if (buf[i] == ' ') continue;
+                        authInfo.append((char) (buf[i] & 0x7f));
+                    }
+//                    headers.addHeader(HTTPConstants.HEADER_AUTHORIZATION, new String(basicAuth) + authInfo.toString());
+                } else {
+                    throw new java.io.IOException("Bad authentication type (I can only handle \"Basic\")");
+                }
+            } else if (endHeaderIndex == locationLen && matches(buf, locationHeader)) {
+                while (++i < n && (buf[i] != '\r') && (buf[i] != '\n')) {
+                    if (buf[i] == ' ') continue;
+                    contentLocation.append((char) (buf[i] & 0x7f));
+                }
+//                headers.addHeader(HTTPConstants.HEADER_CONTENT_LOCATION, contentLocation.toString());
+            } else if (endHeaderIndex == typeLen && matches(buf, typeHeader)) {
+                while (++i < n && (buf[i] != '\r') && (buf[i] != '\n')) {
+                    if (buf[i] == ' ') continue;
+                    contentType.append((char) (buf[i] & 0x7f));
+                }
+//                headers.addHeader(HTTPConstants.HEADER_CONTENT_TYPE, contentLocation.toString());
+            } else {
+                String customHeaderName = new String(buf, 0, endHeaderIndex - 2);
+                StringBuffer customHeaderValue = new StringBuffer();
+                while (++i < n && (buf[i] != '\r') && (buf[i] != '\n')) {
+                    if (buf[i] == ' ') continue;
+                    customHeaderValue.append((char) (buf[i] & 0x7f));
+                }
+//                headers.addHeader(customHeaderName, customHeaderValue.toString());
+            }
+
+        }
+        return len;
+    }
+
+    /**
+     * does tolower[buf] match the target byte array, up to the target's length?
+     */
+    public boolean matches(byte[] buf, byte[] target) {
+        for (int i = 0; i < target.length; i++) {
+            if (toLower[buf[i]] != target[i]) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Case-insensitive match of a target byte [] to a source byte [],
+     * starting from a particular offset into the source.
+     */
+    public boolean matches(byte[] buf, int bufIdx, byte[] target) {
+        for (int i = 0; i < target.length; i++) {
+            if (toLower[buf[bufIdx + i]] != target[i]) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * output an integer into the output stream
+     * @param out       OutputStream to be written to
+     * @param value     Integer value to be written.
+     */
+    protected void putInt(byte buf[], OutputStream out, int value)
+            throws java.io.IOException {
+        int len = 0;
+        int offset = buf.length;
+
+        // negative numbers
+        if (value < 0) {
+            buf[--offset] = (byte) '-';
+            value = -value;
+            len++;
+        }
+
+        // zero
+        if (value == 0) {
+            buf[--offset] = (byte) '0';
+            len++;
+        }
+
+        // positive numbers
+        while (value > 0) {
+            buf[--offset] = (byte) (value % 10 + '0');
+            value = value / 10;
+            len++;
+        }
+
+        // write the result
+        out.write(buf, offset, len);
+    }
+
+    /**
+     * Read a single line from the input stream
+     * @param is        inputstream to read from
+     * @param b         byte array to read into
+     * @param off       starting offset into the byte array
+     * @param len       maximum number of bytes to read
+     */
+    protected int readLine(NonBlockingBufferedInputStream is, byte[] b, int off, int len)
+            throws java.io.IOException {
+        int count = 0, c;
+
+        while ((c = is.read()) != -1) {
+            if (c != '\n' && c != '\r') {
+                b[off++] = (byte) c;
+                count++;
+            }
+            if (count == len) break;
+            if ('\n' == c) {
+                int peek = is.peek(); //If the next line begins with tab or space then this is a continuation.
+                if (peek != ' ' && peek != '\t') break;
+            }
+        }
+        return count > 0 ? count : -1;
+    }
+    protected MessageContext parseTheTransport(
+        AxisEngine engine,
+        InputStream in)throws AxisFault  {
+        byte buf[] = new byte[BUFSIZ];
+        // create an Axis server
+
+        MessageContext msgContext = new MessageContext(engine.getRegistry());
+        msgContext.setServerSide(true);
+
+        // Reusuable, buffered, content length controlled, InputStream
+        NonBlockingBufferedInputStream is =
+                new NonBlockingBufferedInputStream();
+
+        // buffers for the headers we care about
+        StringBuffer soapAction = new StringBuffer();
+        StringBuffer httpRequest = new StringBuffer();
+        StringBuffer fileName = new StringBuffer();
+        StringBuffer cookie = new StringBuffer();
+        StringBuffer cookie2 = new StringBuffer();
+        StringBuffer authInfo = new StringBuffer();
+        StringBuffer contentType = new StringBuffer();
+        StringBuffer contentLocation = new StringBuffer();
+
+        try{
+            // assume the best
+            byte[] status = OK;
+
+            // assume we're not getting WSDL
+            boolean doWsdl = false;
+
+            // cookie for this session, if any
+            String cooky = null;
+
+            String methodName = null;
+
+            authInfo.delete(0, authInfo.length());
+
+            // read headers
+            is.setInputStream(in);
+            // parse all headers into hashtable
+            int contentLength = parseHeaders(is, buf, contentType,
+                    contentLocation, soapAction,
+                    httpRequest, fileName,
+                    cookie, cookie2, authInfo);
+            is.setContentLength(contentLength);
+
+            int paramIdx = fileName.toString().indexOf('?');
+            if (paramIdx != -1) {
+                // Got params
+                String params = fileName.substring(paramIdx + 1);
+                fileName.setLength(paramIdx);
+
+
+                if ("wsdl".equalsIgnoreCase(params))
+                    doWsdl = true;
+
+                if (params.startsWith("method=")) {
+                    methodName = params.substring(7);
+                }
+            }
+
+
+
+            String filePart = fileName.toString();
+            msgContext.setProperty(MessageContext.REQUEST_URL,filePart);
+            if (httpRequest.toString().equals("GET")) {
+                    throw new UnsupportedOperationException("GET not supported"); 
+            } else {
+
+                // this may be "" if either SOAPAction: "" or if no SOAPAction at all.
+                // for now, do not complain if no SOAPAction at all
+                String soapActionString = soapAction.toString();
+                if (soapActionString != null) {
+                    msgContext.setProperty(MessageContext.SOAP_ACTION,soapActionString);
+                }
+                
+
+                InputStreamReader isr = new InputStreamReader(is);
+                XMLStreamReader reader =  XMLInputFactory.newInstance().createXMLStreamReader(isr);
+                StAXBuilder builder = new StAXSOAPModelBuilder(OMFactory.newInstance(),reader);
+                msgContext.setEnvelope((SOAPEnvelope)builder.getDocumentElement());
+
+                EngineRegistry reg = engine.getRegistry();
+                return  msgContext;
+            }    
+            }catch(IOException e){
+                throw AxisFault.makeFault(e); 
+            } catch(XMLStreamException e){
+                throw AxisFault.makeFault(e); 
+            }   
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.axis.impl.transport.AbstractTransportReciver#storeOutputInfo(org.apache.axis.context.MessageContext, java.io.OutputStream)
+     */
+    protected void storeOutputInfo(
+        MessageContext msgContext,
+        OutputStream out)throws AxisFault {
+        try {
+            // Send it on its way...
+            out.write(HTTP);
+            out.write(OK);
+            out.write("\n\n".getBytes());
+            log.info("status written");
+            //We do not have any Addressing Headers to put
+            //let us put the information about incoming transport
+            msgContext.setProperty(MessageContext.TRANSPORT_TYPE,
+                TransportSenderLocator.TRANSPORT_HTTP);
+            msgContext.setProperty(MessageContext.TRANSPORT_DATA,out);
+        } catch (IOException e) {
+            throw AxisFault.makeFault(e);
+        }
+    }
+
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportReceiver.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportReceiver.java?view=auto&rev=111371
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportReceiver.java	Thu Dec  9 01:57:07 2004
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis.impl.transport.tcp;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisEngine;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.TransportSenderLocator;
+import org.apache.axis.impl.llom.builder.StAXBuilder;
+import org.apache.axis.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis.impl.transport.AbstractTransportReceiver;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.SOAPEnvelope;
+import org.apache.axis.registry.EngineRegistry;
+
+/**
+ * @version $Rev: $ $Date: $
+ */
+
+public class TCPTransportReceiver extends AbstractTransportReceiver{
+    public TCPTransportReceiver(AxisEngine myAxisServer) {
+        super(myAxisServer);
+    }
+
+    protected MessageContext parseTheTransport(
+        AxisEngine engine,
+        InputStream in)
+        throws AxisFault {
+        try {
+            MessageContext msgContext = new MessageContext(engine.getRegistry());
+            InputStreamReader isr = new InputStreamReader(in);
+            XMLStreamReader reader =  XMLInputFactory.newInstance().createXMLStreamReader(isr);
+            StAXBuilder builder = new StAXSOAPModelBuilder(OMFactory.newInstance(),reader);
+            msgContext.setEnvelope((SOAPEnvelope)builder.getDocumentElement());
+            
+            EngineRegistry reg = engine.getRegistry();
+            return msgContext;
+        } catch (XMLStreamException e) {
+            throw AxisFault.makeFault(e);
+        }
+    }
+
+    protected void storeOutputInfo(MessageContext msgContext, OutputStream out)
+        throws AxisFault {
+            // Send it on its way...
+            //We do not have any Addressing Headers to put
+            //let us put the information about incoming transport
+            msgContext.setProperty(MessageContext.TRANSPORT_TYPE,
+                TransportSenderLocator.TRANSPORT_TCP);
+            msgContext.setProperty(MessageContext.TRANSPORT_DATA,out);
+
+    }
+
+}

Deleted: /webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportRecvier.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportRecvier.java?view=auto&rev=111370
==============================================================================

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTrasnportSender.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTrasnportSender.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTrasnportSender.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTrasnportSender.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTrasnportSender.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTrasnportSender.java	Thu Dec  9 01:57:07 2004
@@ -16,37 +16,41 @@
 
 package org.apache.axis.impl.transport.tcp;
 
+import java.io.OutputStream;
+
 import org.apache.axis.context.MessageContext;
 import org.apache.axis.engine.AxisFault;
-import org.apache.axis.engine.TransportSender;
-import org.apache.axis.impl.handlers.AbstractHandler;
-import org.apache.axis.impl.llom.serialize.SimpleOMSerializer;
-import org.apache.axis.om.SOAPEnvelope;
-
-import java.io.OutputStream;
+import org.apache.axis.engine.EndpointReferance;
+import org.apache.axis.impl.transport.AbstractTrasnportSender;
 
 /**
  * @author Srinath Perera(hemapani@opensource.lk)
  */
-public class TCPTrasnportSender extends AbstractHandler implements TransportSender{
+public class TCPTrasnportSender extends AbstractTrasnportSender{
     protected OutputStream out;
     
     public TCPTrasnportSender(OutputStream out){
         this.out = out;
     }
     
-    public void invoke(MessageContext msgContext) throws AxisFault {
+    protected OutputStream obtainOutPutStream(MessageContext msgContext) throws AxisFault {
         OutputStream out = (OutputStream)msgContext.getProperty(MessageContext.TRANSPORT_DATA);
-        SOAPEnvelope envelope = msgContext.getEnvelope();
-        if(envelope != null){
-            SimpleOMSerializer serializer = new SimpleOMSerializer();
-            serializer.serialize(envelope,this.out);
-            
+        if(out == null){
+            throw new AxisFault("can not find the suffient information to find endpoint");
+        }else{
+            return out;
         }
+
+    }
+
+    protected OutputStream obtainOutPutStream(MessageContext msgContext,EndpointReferance epr) {
+        throw new UnsupportedOperationException("Addressing not suppotrted yet");
     }
 
-    public void revoke(MessageContext msgContext) {
+    protected void finalizeSending() {
+    }
 
+    protected void startSending() {
     }
 
 }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java	Thu Dec  9 01:57:07 2004
@@ -28,7 +28,7 @@
 import org.apache.axis.impl.engine.ServiceImpl;
 import org.apache.axis.impl.providers.RawXMLProvider;
 import org.apache.axis.impl.registry.ParameterImpl;
-import org.apache.axis.impl.transport.http.SimpleAxisServer;
+import org.apache.axis.impl.transport.http.SimpleHTTPReceiver;
 import org.apache.axis.om.OMElement;
 import org.apache.axis.om.OMFactory;
 import org.apache.axis.om.OMNamespace;
@@ -51,7 +51,7 @@
     private EngineRegistry engineRegistry;
     private MessageContext mc;
     private Thread thisThread = null;
-    private SimpleAxisServer sas;
+    private SimpleHTTPReceiver sas;
     private int testingPort = 7777;
     private int testCount = 0;
     
@@ -95,7 +95,7 @@
         
         AxisEngine engine = new AxisEngine(engineRegistry);
         ServerSocket serverSoc = new ServerSocket(testingPort);
-        sas = new SimpleAxisServer(engine);
+        sas = new SimpleHTTPReceiver(engine);
         sas.setServerSocket(serverSoc);
         thisThread = new Thread(sas);
         thisThread.setDaemon(true);

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java	Thu Dec  9 01:57:07 2004
@@ -29,7 +29,7 @@
 import org.apache.axis.impl.engine.ServiceImpl;
 import org.apache.axis.impl.providers.RawXMLProvider;
 import org.apache.axis.impl.registry.ParameterImpl;
-import org.apache.axis.impl.transport.http.SimpleAxisServer;
+import org.apache.axis.impl.transport.http.SimpleHTTPReceiver;
 import org.apache.axis.om.OMElement;
 import org.apache.axis.om.OMFactory;
 import org.apache.axis.om.OMNamespace;
@@ -52,7 +52,7 @@
     private EngineRegistry engineRegistry;
     private MessageContext mc;
     private Thread thisThread = null;
-    private SimpleAxisServer sas;
+    private SimpleHTTPReceiver sas;
     private int testingPort = 7777;
     private int testCount = 0;
     
@@ -96,7 +96,7 @@
         
         AxisEngine engine = new AxisEngine(engineRegistry);
         ServerSocket serverSoc = new ServerSocket(testingPort);
-        sas = new SimpleAxisServer(engine);
+        sas = new SimpleHTTPReceiver(engine);
         sas.setServerSocket(serverSoc);
         thisThread = new Thread(sas);
         thisThread.setDaemon(true);

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoTest.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoTest.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoTest.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoTest.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoTest.java	Thu Dec  9 01:57:07 2004
@@ -29,7 +29,7 @@
 
 import org.apache.axis.AbstractTestCase;
 import org.apache.axis.context.MessageContext;
-import org.apache.axis.impl.transport.http.SimpleAxisServer;
+import org.apache.axis.impl.transport.http.SimpleHTTPReceiver;
 import org.apache.axis.registry.EngineRegistry;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -46,7 +46,7 @@
     private EngineRegistry engineRegistry;
     private MessageContext mc;
     private Thread thisThread = null;
-    private SimpleAxisServer sas;
+    private SimpleHTTPReceiver sas;
     private int testingPort = 1234;
 
     public EchoTest(String testName) {
@@ -56,7 +56,7 @@
     protected void setUp() throws Exception {
         engineRegistry = Utils.createMockRegistry(serviceName,operationName,transportName);
         AxisEngine engine = new AxisEngine(engineRegistry);
-        sas = new SimpleAxisServer(engine);
+        sas = new SimpleHTTPReceiver(engine);
         sas.setServerSocket(new ServerSocket(testingPort));
         thisThread = new Thread(sas);
         thisThread.start();

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java	Thu Dec  9 01:57:07 2004
@@ -18,7 +18,7 @@
 import java.io.IOException;
 import java.net.ServerSocket;
 
-import org.apache.axis.impl.transport.http.SimpleAxisServer;
+import org.apache.axis.impl.transport.http.SimpleHTTPReceiver;
 import org.apache.axis.registry.EngineRegistry;
 import org.apache.axis.registry.Flow;
 
@@ -38,10 +38,10 @@
         }
     }
     
-    public static SimpleAxisServer startServer(EngineRegistry engineRegistry) throws IOException{
+    public static SimpleHTTPReceiver startServer(EngineRegistry engineRegistry) throws IOException{
         AxisEngine engine = new AxisEngine(engineRegistry);
         ServerSocket serverSoc = new ServerSocket(TESTING_PORT);
-        SimpleAxisServer sas = new SimpleAxisServer(engine);
+        SimpleHTTPReceiver sas = new SimpleHTTPReceiver(engine);
         sas.setServerSocket(serverSoc);
         Thread thisThread = new Thread(sas);
         thisThread.setDaemon(true);

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java	Thu Dec  9 01:57:07 2004
@@ -29,7 +29,7 @@
 import org.apache.axis.impl.providers.RawXMLProvider;
 import org.apache.axis.impl.registry.FlowImpl;
 import org.apache.axis.impl.registry.ParameterImpl;
-import org.apache.axis.impl.transport.http.SimpleAxisServer;
+import org.apache.axis.impl.transport.http.SimpleHTTPReceiver;
 import org.apache.axis.om.OMElement;
 import org.apache.axis.om.OMFactory;
 import org.apache.axis.om.OMNamespace;
@@ -54,7 +54,7 @@
     private EngineRegistry engineRegistry;
     private MessageContext mc;
     private Thread thisThread = null;
-    private SimpleAxisServer sas;
+    private SimpleHTTPReceiver sas;
     private int testingPort = 7777;
     private int testCount = 0;
     

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/SimpleAxisServerTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/SimpleAxisServerTest.java?view=diff&rev=111371&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/SimpleAxisServerTest.java&r1=111370&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/SimpleAxisServerTest.java&r2=111371
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/SimpleAxisServerTest.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/SimpleAxisServerTest.java	Thu Dec  9 01:57:07 2004
@@ -26,7 +26,7 @@
 import org.apache.axis.impl.engine.ServiceImpl;
 import org.apache.axis.impl.providers.RawXMLProvider;
 import org.apache.axis.impl.registry.ParameterImpl;
-import org.apache.axis.impl.transport.http.SimpleAxisServer;
+import org.apache.axis.impl.transport.http.SimpleHTTPReceiver;
 import org.apache.axis.registry.EngineRegistry;
 import org.apache.axis.registry.Operation;
 import org.apache.axis.registry.Parameter;
@@ -43,7 +43,7 @@
     private EngineRegistry engineRegistry;
     private MessageContext mc;
     private Thread thisThread = null;
-    private SimpleAxisServer sas;
+    private SimpleHTTPReceiver sas;
     private int testingPort = 7777;
     private int testCount = 0;
     private AxisEngine engine;
@@ -95,7 +95,7 @@
 
     public void testEchoXMLSync() throws Exception{
         ServerSocket serverSoc = new ServerSocket(testingPort);
-        sas = new SimpleAxisServer(engine);
+        sas = new SimpleHTTPReceiver(engine);
         sas.setServerSocket(serverSoc);
         thisThread = new Thread(sas);
         thisThread.setDaemon(true);
@@ -103,7 +103,7 @@
         sas.stop();
         Thread.sleep(1000);
         serverSoc = new ServerSocket(testingPort);
-        sas = new SimpleAxisServer(engine);
+        sas = new SimpleHTTPReceiver(engine);
         sas.setServerSocket(serverSoc);
         thisThread = new Thread(sas);
         thisThread.setDaemon(true);
@@ -111,7 +111,7 @@
         sas.stop();            
         Thread.sleep(1000);
         serverSoc = new ServerSocket(testingPort);
-        sas = new SimpleAxisServer(engine);
+        sas = new SimpleHTTPReceiver(engine);
         sas.setServerSocket(serverSoc);
         thisThread = new Thread(sas);
         thisThread.setDaemon(true);