axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject svn commit: r171224 [1/2] - in /webservices/axis/trunk/java: ./ etc/ modules/core/src/org/apache/axis/ modules/core/src/org/apache/axis/clientapi/ modules/core/src/org/apache/axis/context/ modules/core/src/org/apache/axis/deployment/ modules/core/src/org/apache/axis/engine/ modules/core/src/org/apache/axis/receivers/ modules/core/src/org/apache/axis/transport/ modules/core/src/org/apache/axis/transport/http/ modules/core/src/org/apache/axis/transport/tcp/ modules/core/test/org/apache/axis/context/ modules/core/test/org/apache/axis/transport/ modules/core/test/org/apache/axis/transport/tcp/ modules/samples/ modules/samples/test/org/apache/axis/engine/ modules/samples/test/org/apache/axis/integration/
Date Sat, 21 May 2005 15:23:11 GMT
Author: hemapani
Date: Sat May 21 08:23:10 2005
New Revision: 171224

URL: http://svn.apache.org/viewcvs?rev=171224&view=rev
Log:
add the TCP and REST web services, cleanup the Call

Added:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/TwoChannelBasedSender.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis/context/ContextHireachyTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis/transport/sample.xml
    webservices/axis/trunk/java/modules/core/test/org/apache/axis/transport/tcp/
    webservices/axis/trunk/java/modules/core/test/org/apache/axis/transport/tcp/TCPTransportTest.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/RESTBasedEchoRawXMLTest.java
Modified:
    webservices/axis/trunk/java/etc/project.xml
    webservices/axis/trunk/java/maven.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOnlyMEPClient.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/AbstractContext.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/client.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AddressingBasedDispatcher.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractMessageReceiver.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/AbstractTransportSender.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/AxisServlet.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportReceiver.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/SimpleHTTPServer.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/tcp/TCPTransportSender.java
    webservices/axis/trunk/java/modules/samples/build.xml
    webservices/axis/trunk/java/modules/samples/project.xml
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/TCPEchoRawXMLTest.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilServer.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilsTCPServer.java

Modified: webservices/axis/trunk/java/etc/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/etc/project.xml?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/etc/project.xml (original)
+++ webservices/axis/trunk/java/etc/project.xml Sat May 21 08:23:10 2005
@@ -196,6 +196,13 @@
           		<include>**/*.xml</include>
         	</includes>
       </resource>
+      <resource>
+       	 	<directory>test</directory>
+        	<includes>
+          		<include>**/*.properties</include>
+          		<include>**/*.xml</include>
+        	</includes>
+      </resource>
      </resources>
     </unitTest>
     

Modified: webservices/axis/trunk/java/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/maven.xml?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/maven.xml (original)
+++ webservices/axis/trunk/java/maven.xml Sat May 21 08:23:10 2005
@@ -149,7 +149,7 @@
 			</ant:fileset> 
 		</ant:copy>
 		<ant:copy todir="target/dist-bin/samples">
-			<ant:fileset dir="modules/samples/src/java">
+			<ant:fileset dir="modules/samples/src">
 				<ant:include name="userguide/**"/>
 			</ant:fileset> 
 		</ant:copy> 
@@ -201,10 +201,10 @@
            use="true"
            windowtitle="Axis2 API">
            		<ant:sourcepath>
-	           		<ant:pathelement location="modules/core/src/java"/>
-	           		<ant:pathelement location="modules/deployment/src/java"/>	           		
-	           		<ant:pathelement location="modules/wsdl/src/java"/>
-	           		<ant:pathelement location="modules/om/src/java"/>
+	           		<ant:pathelement location="modules/core/src"/>
+	           		<ant:pathelement location="modules/deployment/src"/>	           		
+	           		<ant:pathelement location="modules/wsdl/src"/>
+	           		<ant:pathelement location="modules/om/src"/>
            </ant:sourcepath>
   </ant:javadoc>
   </goal>

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java Sat May 21 08:23:10 2005
@@ -102,6 +102,8 @@
     public static final String ERROR_SERVICE_MAP = "errprservicemap";
 
     public static final String IS_FAULTY = "Fault";
+    
+    public static final String DO_REST = "doREST";
 
 
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java Sat May 21 08:23:10 2005
@@ -121,8 +121,8 @@
      * @param key
      * @return
      */
-    public Object get(Object key) {
-        return properties.get(key);
+    public Object get(String key) {
+        return serviceContext.getProperty(key);
     }
 
     /**
@@ -130,7 +130,7 @@
      * @param value
      * @return
      */
-    public Object set(Object key, Object value) {
-        return properties.put(key, value);
+    public void set(String key, Object value) {
+        serviceContext.getEngineContext().setProperty(key,value);
     }
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOnlyMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOnlyMEPClient.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOnlyMEPClient.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOnlyMEPClient.java Sat May 21 08:23:10 2005
@@ -80,7 +80,7 @@
 
         //TODO Fix this we support only the HTTP Sync cases, so we hardcode this
         HTTPTransportReceiver receiver = new HTTPTransportReceiver();
-        receiver.checkForResponse(response, sysContext);
+        receiver.checkForMessage(response, sysContext);
         SOAPEnvelope resenvelope = response.getEnvelope();
         if (response!= null && resenvelope.getBody().hasFault()) {
             throw new AxisFault(resenvelope.getBody().getFault().getException());

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/InOutMEPClient.java Sat May 21 08:23:10 2005
@@ -77,7 +77,6 @@
      * This is used for the Receiving the Async Messages 
      */
     protected CallbackReceiver callbackReceiver;
-
     /**
      * This accepts a ServiceContext, and the ServiceContext should have all the parents set in to it right
      * Ideall this should be generated from a WSDL, we do not have it yet. 
@@ -112,7 +111,9 @@
     //        throw new UnsupportedOperationException();
     //    }
 
-    public MessageContext invokeBlocking(OperationDescription axisop, final MessageContext msgctx)
+    public MessageContext invokeBlocking(
+        OperationDescription axisop,
+        final MessageContext msgctx)
         throws AxisFault {
         verifyInvocation(axisop);
 
@@ -125,63 +126,33 @@
         ConfigurationContext sysContext = serviceContext.getEngineContext();
         AxisConfiguration registry = sysContext.getEngineConfig();
 
-        try {
-
-            AxisEngine engine = new AxisEngine(sysContext);
-            msgctx.setOperationContext(
-                OperationContextFactory.createMEPContext(
-                    WSDLConstants.MEP_CONSTANT_IN_OUT,
-                    false,
-                    axisop,
-                    serviceContext));
-
-            engine.send(msgctx);
-
-            MessageContext response =
-                new MessageContext(
-                    msgctx.getSessionContext(),
-                    msgctx.getTransportIn(),
-                    msgctx.getTransportOut(),
-                    msgctx.getSystemContext());
-            response.setProperty(
-                MessageContext.TRANSPORT_READER,
-                msgctx.getProperty(MessageContext.TRANSPORT_READER));
-            response.setServerSide(false);
-            response.setOperationContext(msgctx.getOperationContext());
-            response.setServiceContext(msgctx.getServiceContext());
-
-            SOAPEnvelope resenvelope = checkReturnChannel(response);
-            if (resenvelope != null) {
-                response.setEnvelope(resenvelope);
-                engine = new AxisEngine(serviceContext.getEngineContext());
-                engine.receive(response);
-
-                resenvelope = response.getEnvelope();
-                if (resenvelope.getBody().hasFault()) {
-                    throw new AxisFault(resenvelope.getBody().getFault().getException());
-                }
-            } else {
-                throw new AxisFault("Blocking invocation always expect a response");
-            }
-            response.getTransportOut().getSender().cleanUp();
-            return response;
-        } catch (OMException e) {
-            throw AxisFault.makeFault(e);
-        } catch (IOException e) {
-            throw AxisFault.makeFault(e);
+        msgctx.setOperationContext(
+            OperationContextFactory.createMEPContext(
+                WSDLConstants.MEP_CONSTANT_IN_OUT,
+                false,
+                axisop,
+                serviceContext));
+        MessageContext response =
+            TwoChannelBasedSender.send(msgctx, listenerTransport);
+
+        SOAPEnvelope resenvelope = response.getEnvelope();
+        if (resenvelope.getBody().hasFault()) {
+            throw new AxisFault(
+                resenvelope.getBody().getFault().getException());
         }
-
+        return response;
     }
 
     public void invokeNonBlocking(
-        OperationDescription axisop,
+        final OperationDescription axisop,
         final MessageContext msgctx,
         final Callback callback)
         throws AxisFault {
         verifyInvocation(axisop);
         msgctx.setTo(to);
         try {
-            final ConfigurationContext syscontext = serviceContext.getEngineContext();
+            final ConfigurationContext syscontext =
+                serviceContext.getEngineContext();
 
             AxisEngine engine = new AxisEngine(syscontext);
             //TODO
@@ -194,57 +165,91 @@
                 callbackReceiver.addCallback(messageID, callback);
                 msgctx.setReplyTo(
                     ListenerManager.replyToEPR(
-                        serviceContext.getServiceConfig().getName().getLocalPart()
+                        serviceContext
+                            .getServiceConfig()
+                            .getName()
+                            .getLocalPart()
                             + "/"
                             + axisop.getName().getLocalPart(),
                         listenerTransport));
+                msgctx.setOperationContext(
+                    axisop.findOperationContext(msgctx, serviceContext, false));
+                msgctx.setServiceContext(serviceContext);
+                engine.send(msgctx);
+                msgctx.getTransportOut().getSender().cleanUp();
 
-            }
-            msgctx.setOperationContext(axisop.findOperationContext(msgctx, serviceContext, false));
-            msgctx.setServiceContext(serviceContext);
-            engine.send(msgctx);
-
-            //TODO start the server
-            if (!useSeparateListener) {
-                Runnable newThread = new Runnable() {
+            } else {
+                Thread thread = new Thread(new Runnable() {
                     public void run() {
                         try {
+                            msgctx.setOperationContext(
+                                OperationContextFactory.createMEPContext(
+                                    WSDLConstants.MEP_CONSTANT_IN_OUT,
+                                    false,
+                                    axisop,
+                                    serviceContext));
+                            msgctx.setServiceContext(serviceContext);
                             MessageContext response =
-                                new MessageContext(
-                                    msgctx.getSessionContext(),
-                                    msgctx.getTransportIn(),
-                                    msgctx.getTransportOut(),
-                                    msgctx.getSystemContext());
-                            response.setServerSide(false);
-                            response.setProperty(
-                                MessageContext.TRANSPORT_READER,
-                                msgctx.getProperty(MessageContext.TRANSPORT_READER));
-                            response.setOperationContext(msgctx.getOperationContext());
-                            response.setServiceContext(msgctx.getServiceContext());
-
-                            SOAPEnvelope resenvelope = checkReturnChannel(response);
-                            if (resenvelope != null) {
-                                response.setEnvelope(resenvelope);
-                                AxisEngine engine =
-                                    new AxisEngine(serviceContext.getEngineContext());
-                                engine.receive(response);
-
-                                resenvelope = response.getEnvelope();
-                                AsyncResult asyncResult = new AsyncResult();
-                                asyncResult.setResult(resenvelope);
-                                callback.onComplete(asyncResult);
-                            } else {
-                                throw new AxisFault("Blocking invocation always expect a response");
-                            }
+                                TwoChannelBasedSender.send(
+                                    msgctx,
+                                    listenerTransport);
+                            SOAPEnvelope resenvelope = response.getEnvelope();
+                            AsyncResult asyncResult = new AsyncResult();
+                            asyncResult.setResult(resenvelope);
+                            callback.onComplete(asyncResult);
                         } catch (AxisFault e) {
                             callback.reportError(e);
                         }
-
                     }
-                };
-                (new Thread(newThread)).start();
+                });
+                thread.start();
             }
-            msgctx.getTransportOut().getSender().cleanUp();
+
+            //            //TODO start the server
+            //            if (!useSeparateListener) {
+            //                Runnable newThread = new Runnable() {
+            //                    public void run() {
+            //                        try {
+            //                            MessageContext response =
+            //                                new MessageContext(
+            //                                    msgctx.getSessionContext(),
+            //                                    msgctx.getTransportIn(),
+            //                                    msgctx.getTransportOut(),
+            //                                    msgctx.getSystemContext());
+            //                            response.setServerSide(false);
+            //                            response.setProperty(
+            //                                MessageContext.TRANSPORT_READER,
+            //                                msgctx.getProperty(
+            //                                    MessageContext.TRANSPORT_READER));
+            //                            response.setOperationContext(
+            //                                msgctx.getOperationContext());
+            //                            response.setServiceContext(
+            //                                msgctx.getServiceContext());
+            //
+            //                            SOAPEnvelope resenvelope =
+            //                                checkReturnChannel(response);
+            //                            if (resenvelope != null) {
+            //                                response.setEnvelope(resenvelope);
+            //                                AxisEngine engine =
+            //                                    new AxisEngine(
+            //                                        serviceContext.getEngineContext());
+            //                                engine.receive(response);
+            //
+            //                                resenvelope = response.getEnvelope();
+            //                                AsyncResult asyncResult = new AsyncResult();
+            //                                asyncResult.setResult(resenvelope);
+            //                                callback.onComplete(asyncResult);
+            //                            } else {
+            //                                throw new AxisFault("Blocking invocation always expect a response");
+            //                            }
+            //                        } catch (AxisFault e) {
+            //                            callback.reportError(e);
+            //                        }
+            //
+            //                    }
+            //                };
+            //                (new Thread(newThread)).start();
+            //            }
 
         } catch (OMException e) {
             throw AxisFault.makeFault(e);
@@ -296,26 +301,37 @@
         }
 
         if (useSeparateListener == true) {
-            ListenerManager.makeSureStarted(listenerTransport, serviceContext.getEngineContext());
+            ListenerManager.makeSureStarted(
+                listenerTransport,
+                serviceContext.getEngineContext());
         }
     }
 
-    private SOAPEnvelope checkReturnChannel(MessageContext response) throws AxisFault {
+    private SOAPEnvelope checkReturnChannel(MessageContext response)
+        throws AxisFault {
         SOAPEnvelope resenvelope = null;
         try {
             //TODO Fix this we support only the HTTP Sync cases, so we hardcode this
             if (Constants.TRANSPORT_HTTP.equals(listenerTransport)) {
                 HTTPTransportReceiver receiver = new HTTPTransportReceiver();
                 resenvelope =
-                    receiver.checkForResponse(response, serviceContext.getEngineContext());
+                    receiver.checkForMessage(
+                        response,
+                        serviceContext.getEngineContext());
             } else if (Constants.TRANSPORT_TCP.equals(listenerTransport)) {
-                Reader in = (Reader) response.getProperty(MessageContext.TRANSPORT_READER);
-                if(in != null){
-                    XMLStreamReader xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in);
+                Reader in =
+                    (Reader) response.getProperty(
+                        MessageContext.TRANSPORT_READER);
+                if (in != null) {
+                    XMLStreamReader xmlreader =
+                        XMLInputFactory.newInstance().createXMLStreamReader(in);
                     StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader);
                     resenvelope = (SOAPEnvelope) builder.getDocumentElement();
-                }else{
-                    throw new AxisFault("Sync invocation expect a proeprty "+ MessageContext.TRANSPORT_READER + " set ");
+                } else {
+                    throw new AxisFault(
+                        "Sync invocation expect a proeprty "
+                            + MessageContext.TRANSPORT_READER
+                            + " set ");
                 }
             }
         } catch (XMLStreamException e) {
@@ -336,7 +352,10 @@
 
         if (msgctx.getTransportIn() == null) {
             final TransportInDescription transportIn =
-                serviceContext.getEngineContext().getEngineConfig().getTransportIn(
+                serviceContext
+                    .getEngineContext()
+                    .getEngineConfig()
+                    .getTransportIn(
                     new QName(senderTransport));
             if (transportIn != null) {
                 msgctx.setTransportIn(transportIn);
@@ -347,7 +366,10 @@
         }
         if (msgctx.getTransportOut() == null) {
             final TransportOutDescription transportOut =
-                serviceContext.getEngineContext().getEngineConfig().getTransportOut(
+                serviceContext
+                    .getEngineContext()
+                    .getEngineConfig()
+                    .getTransportOut(
                     new QName(listenerTransport));
             if (transportOut != null) {
                 msgctx.setTransportOut(transportOut);

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java Sat May 21 08:23:10 2005
@@ -57,7 +57,7 @@
 //
 //	public abstract Object _getSessionInfo(Object key) throws Exception ;
 
-     public void _setSessionInfo(Object key, Object value)throws java.lang.Exception{
+     public void _setSessionInfo(String key, Object value)throws java.lang.Exception{
 		if(!_maintainSession){
 			//TODO Comeup with a Exception
 			throw new java.lang.Exception("Client is running the session OFF mode: Start session before saving to a session ");
@@ -66,7 +66,7 @@
 	}
 
 
-	public Object _getSessionInfo(Object key) throws java.lang.Exception{
+	public Object _getSessionInfo(String key) throws java.lang.Exception{
 		if(!_maintainSession){
 			//TODO Comeup with a Exception
 			throw new java.lang.Exception("Client is running the session OFF mode: Start session before saving to a session ");

Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/TwoChannelBasedSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/TwoChannelBasedSender.java?rev=171224&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/TwoChannelBasedSender.java (added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/TwoChannelBasedSender.java Sat May 21 08:23:10 2005
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2004,2005 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.clientapi;
+
+import java.io.Reader;
+
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.axis.Constants;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisEngine;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.impl.llom.builder.StAXBuilder;
+import org.apache.axis.soap.SOAPEnvelope;
+import org.apache.axis.soap.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis.transport.http.HTTPTransportReceiver;
+
+
+public class TwoChannelBasedSender {
+    public static MessageContext send(MessageContext msgctx,String listenerTransport) throws AxisFault{
+       
+        AxisEngine engine = new AxisEngine(msgctx.getSystemContext());
+       
+
+        engine.send(msgctx);
+
+        MessageContext response =
+            new MessageContext(
+                msgctx.getSessionContext(),
+                msgctx.getTransportIn(),
+                msgctx.getTransportOut(),
+                msgctx.getSystemContext());
+        response.setProperty(
+            MessageContext.TRANSPORT_READER,
+            msgctx.getProperty(MessageContext.TRANSPORT_READER));
+        response.setServerSide(false);
+        response.setOperationContext(msgctx.getOperationContext());
+        response.setServiceContext(msgctx.getServiceContext());
+
+        
+        SOAPEnvelope resenvelope = null;
+                try {
+                    //TODO Fix this we support only the HTTP Sync cases, so we hardcode this
+                    if (Constants.TRANSPORT_HTTP.equals(listenerTransport)) {
+                        HTTPTransportReceiver receiver = new HTTPTransportReceiver();
+                        resenvelope =
+                            receiver.checkForMessage(response,msgctx.getSystemContext());
+                    } else if (Constants.TRANSPORT_TCP.equals(listenerTransport)) {
+                        Reader in = (Reader) response.getProperty(MessageContext.TRANSPORT_READER);
+                        if(in != null){
+                            XMLStreamReader xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in);
+                            StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader);
+                            resenvelope = (SOAPEnvelope) builder.getDocumentElement();
+                        }else{
+                            throw new AxisFault("Sync invocation expect a proeprty "+ MessageContext.TRANSPORT_READER + " set ");
+                        }
+                    }
+                } catch (XMLStreamException e) {
+                    throw new AxisFault(e);
+                } catch (FactoryConfigurationError e) {
+                    throw new AxisFault(e);
+                }
+                
+
+
+
+        if (resenvelope != null) {
+            response.setEnvelope(resenvelope);
+            engine = new AxisEngine(msgctx.getSystemContext());
+            engine.receive(response);
+
+        } else {
+            throw new AxisFault("Blocking invocation always expect a response");
+        }
+        response.getTransportOut().getSender().cleanUp();
+        return response;
+    }
+}

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/AbstractContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/AbstractContext.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/AbstractContext.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/AbstractContext.java Sat May 21 08:23:10 2005
@@ -25,7 +25,7 @@
 
     protected transient final HashMap nonPersistentMap;
     protected final HashMap persistentMap;
-    protected final AbstractContext parent;
+    protected AbstractContext parent;
 
     protected AbstractContext(AbstractContext parent) {
         this.persistentMap = new HashMap();
@@ -42,7 +42,7 @@
      * @param value
      * @param persistent
      */
-    public void setProperty(Object key, Object value, boolean persistent) {
+    public void setProperty(String key, Object value, boolean persistent) {
         if (persistent) {
             persistentMap.put(key, value);
         } else {
@@ -57,7 +57,7 @@
      * @param key
      * @param value
      */
-    public void setProperty(Object key, Object value) {
+    public void setProperty(String key, Object value) {
         this.setProperty(key, value, false);
     }
 
@@ -68,7 +68,7 @@
      * @param key
      * @return
      */
-    public Object getProperty(Object key) {
+    public Object getProperty(String key) {
         return this.getProperty(key, false);
     }
 
@@ -77,17 +77,31 @@
      * @param persistent
      * @return
      */
-    public Object getProperty(Object key, boolean persistent) {
-        Object obj;
+    public Object getProperty(String key, boolean persistent) {
+        Object obj = null;
         if (persistent) {
             obj = persistentMap.get(key);
-
-        } else {
-            return nonPersistentMap.get(key);
+        }
+        if(obj == null){
+            obj =  nonPersistentMap.get(key);
         }
         if (obj == null && parent != null) {
             obj = parent.getProperty(key, persistent);
         }
         return obj;
     }
+    /**
+     * @param context
+     */
+    public void setParent(AbstractContext context) {
+        parent = context;
+    }
+
+    /**
+     * @return
+     */
+    public AbstractContext getParent() {
+        return parent;
+    }
+
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/MessageContext.java Sat May 21 08:23:10 2005
@@ -18,8 +18,12 @@
 import org.apache.axis.addressing.EndpointReference;
 import org.apache.axis.addressing.MessageInformationHeadersCollection;
 import org.apache.axis.addressing.miheaders.RelatesTo;
+import org.apache.axis.description.OperationDescription;
+import org.apache.axis.description.Parameter;
+import org.apache.axis.description.ServiceDescription;
 import org.apache.axis.description.TransportInDescription;
 import org.apache.axis.description.TransportOutDescription;
+import org.apache.axis.engine.AxisConfiguration;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.soap.SOAPEnvelope;
 
@@ -59,7 +63,6 @@
 
     private MessageInformationHeadersCollection messageInformationHeaders;
 
-    
     private OperationContext operationContext;
     private ServiceContext serviceContext;
     private ConfigurationContext engineContext;
@@ -359,7 +362,6 @@
      *
      * @return
      */
-  
 
     public void setWSAAction(String actionURI) {
         messageInformationHeaders.setAction(actionURI);
@@ -435,6 +437,10 @@
      */
     public void setOperationContext(OperationContext context) {
         operationContext = context;
+        if (serviceContext != null && operationContext.getParent() == null) {
+            operationContext.setParent(serviceContext);
+        }
+        this.setParent(operationContext);
     }
 
     /**
@@ -488,6 +494,9 @@
      */
     public void setServiceContext(ServiceContext context) {
         serviceContext = context;
+        if (operationContext != null && operationContext.getParent() != null) {
+            operationContext.setParent(context);
+        }
     }
 
     /**
@@ -497,4 +506,39 @@
         messageInformationHeaders = collection;
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.axis.context.AbstractContext#getProperty(java.lang.Object, boolean)
+     */
+    public Object getProperty(String key, boolean persistent) {
+        Object obj = super.getProperty(key, persistent);
+
+        //The context hirachy might not have constructed fully, the check should 
+        //look for the disconnected grandparents
+        if (obj == null
+            && operationContext == null
+            && serviceContext != null) {
+            obj = serviceContext.getProperty(key, persistent);
+        }
+        if (obj == null && operationContext == null) {
+            obj = engineContext.getProperty(key, persistent);
+        }
+        //Search the configurations
+        Parameter param = null;
+        if (obj == null && operationContext != null) {
+            OperationDescription opDesc = operationContext.getAxisOperation();
+            param = opDesc.getParameter(key);
+        }
+        if (param == null && serviceContext != null) {
+            ServiceDescription serviceDesc = serviceContext.getServiceConfig();
+            param = serviceDesc.getParameter(key);
+        }
+        if (param == null && engineContext != null) {
+            AxisConfiguration baseConfig = engineContext.getEngineConfig();
+            param = baseConfig.getParameter(key);
+        }
+        if (param != null) {
+            obj = param.getValue();
+        }
+        return obj;
+    }
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/client.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/client.xml?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/client.xml (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/client.xml Sat May 21 08:23:10 2005
@@ -7,5 +7,7 @@
     </transportReceiver>
     <transportSender name="http" class="org.apache.axis.transport.http.HTTPTransportSender">
     </transportSender>
+    <transportReceiver name="tcp"/>
+    <transportSender name="tcp" class="org.apache.axis.transport.tcp.TCPTransportSender"/>
 </client>
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml Sat May 21 08:23:10 2005
@@ -8,6 +8,11 @@
     </transportReceiver>
     <transportSender name="http" class="org.apache.axis.transport.http.HTTPTransportSender">
     </transportSender>
+    <transportReceiver name="tcp"/>
+    <transportSender name="tcp" class="org.apache.axis.transport.tcp.TCPTransportSender"/>
+    
+    
+    
    <!--   <module ref="addressing"/> -->
     <phaseOrder type="inflow">
         <!--  System pre defined phases       -->

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AddressingBasedDispatcher.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AddressingBasedDispatcher.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AddressingBasedDispatcher.java Sat May 21 08:23:10 2005
@@ -62,13 +62,16 @@
      */
     public ServiceDescription findService(MessageContext messageContext) throws AxisFault {
         EndpointReference toEPR = messageContext.getTo();
-        QName serviceName = new QName(toEPR.getAddress());
-        ServiceDescription service = messageContext.getSystemContext().getEngineConfig().getService(serviceName);
+        ServiceDescription service = null;
+        if(toEPR != null){
+            QName serviceName = new QName(toEPR.getAddress());
+            service = messageContext.getSystemContext().getEngineConfig().getService(serviceName);
+        }
 
         if (service != null) {
             return service;
         } else {
-            throw new AxisFault("No service found under the " + toEPR.getAddress());
+            throw new AxisFault("No service found under the Service " + ((toEPR!= null)?toEPR.getAddress():""));
         }
     }
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java Sat May 21 08:23:10 2005
@@ -28,7 +28,7 @@
  * Service states kept in the <code>MessageContext</code>. Other runtime
  * artifacts does not keep states foward from the execution.
  */
-public interface AxisConfiguration {
+public interface AxisConfiguration extends ParameterInclude{
     /**
      * Field INFLOW
      */

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/RequestURIBasedDispatcher.java Sat May 21 08:23:10 2005
@@ -43,7 +43,9 @@
         init(new HandlerDescription(NAME));
     }
 
-    public OperationDescription findOperation(ServiceDescription service, MessageContext messageContext)
+    public OperationDescription findOperation(
+        ServiceDescription service,
+        MessageContext messageContext)
         throws AxisFault {
         if (operatoinName != null) {
             OperationDescription axisOp = service.getOperation(operatoinName);
@@ -56,29 +58,36 @@
     /* (non-Javadoc)
      * @see org.apache.axis.engine.AbstractDispatcher#findService(org.apache.axis.context.MessageContext)
      */
-    public ServiceDescription findService(MessageContext messageContext) throws AxisFault {
+    public ServiceDescription findService(MessageContext messageContext)
+        throws AxisFault {
         final String URI_ID_STRING = "/services";
         if (messageContext.isServerSide()) {
 
             EndpointReference toEPR = messageContext.getTo();
-            String filePart = toEPR.getAddress();
+            if (toEPR != null) {
+                String filePart = toEPR.getAddress();
 
-            int index = filePart.lastIndexOf(URI_ID_STRING);
-            String serviceStr = null;
-            if (index > 0) {
-                serviceStr = filePart.substring(index + URI_ID_STRING.length() + 1);
-
-                ConfigurationContext engineContext = messageContext.getSystemContext();
-
-                if ((index = serviceStr.indexOf('/')) > 0) {
-                    serviceName = new QName(serviceStr.substring(0, index));
-                    operatoinName = new QName(serviceStr.substring(index + 1));
-                } else {
-                    serviceName = new QName(serviceStr);
+                int index = filePart.lastIndexOf(URI_ID_STRING);
+                String serviceStr = null;
+                if (index > 0) {
+                    serviceStr =
+                        filePart.substring(index + URI_ID_STRING.length() + 1);
+
+                    ConfigurationContext engineContext =
+                        messageContext.getSystemContext();
+
+                    if ((index = serviceStr.indexOf('/')) > 0) {
+                        serviceName = new QName(serviceStr.substring(0, index));
+                        operatoinName =
+                            new QName(serviceStr.substring(index + 1));
+                    } else {
+                        serviceName = new QName(serviceStr);
+                    }
+
+                    AxisConfiguration registry =
+                        messageContext.getSystemContext().getEngineConfig();
+                    return registry.getService(serviceName);
                 }
-
-                AxisConfiguration registry = messageContext.getSystemContext().getEngineConfig();
-                return registry.getService(serviceName);
             }
         }
         return null;

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractMessageReceiver.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractMessageReceiver.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/receivers/AbstractMessageReceiver.java Sat May 21 08:23:10 2005
@@ -74,18 +74,18 @@
             return makeNewServiceObject(msgContext);
         } else if (Constants.SESSION_SCOPE.equals(scope)) {
             SessionContext sessionContext = msgContext.getSessionContext();
-            Object obj = sessionContext.getProperty(serviceName);
+            Object obj = sessionContext.getProperty(serviceName.getLocalPart());
             if (obj == null) {
                 obj = makeNewServiceObject(msgContext);
-                sessionContext.setProperty(serviceName, obj);
+                sessionContext.setProperty(serviceName.getLocalPart(), obj);
             }
             return obj;
         } else if (Constants.APPLICATION_SCOPE.equals(scope)) {
             SessionContext globalContext = msgContext.getSessionContext();
-            Object obj = globalContext.getProperty(serviceName);
+            Object obj = globalContext.getProperty(serviceName.getLocalPart());
             if (obj == null) {
                 obj = makeNewServiceObject(msgContext);
-                globalContext.setProperty(serviceName, obj);
+                globalContext.setProperty(serviceName.getLocalPart(), obj);
             }
             return obj;
         } else {

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/AbstractTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/AbstractTransportSender.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/AbstractTransportSender.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/AbstractTransportSender.java Sat May 21 08:23:10 2005
@@ -15,27 +15,32 @@
  */
 package org.apache.axis.transport;
 
+import java.io.Writer;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.axis.Constants;
 import org.apache.axis.addressing.AddressingConstants;
 import org.apache.axis.addressing.EndpointReference;
 import org.apache.axis.context.MessageContext;
 import org.apache.axis.description.HandlerDescription;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.handlers.AbstractHandler;
+import org.apache.axis.om.OMElement;
 import org.apache.axis.soap.SOAPEnvelope;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamWriter;
-import java.io.Writer;
-
 /**
  * By the time this Class is invoked either the To EPR on the MessageContext should be set or
  * TRANSPORT_WRITER property set in the message Context with a Writer. This Class would write the 
  * SOAPMessage using either of the methods in the order To then Writer.
  */
-public abstract class AbstractTransportSender extends AbstractHandler implements TransportSender {
+public abstract class AbstractTransportSender
+    extends AbstractHandler
+    implements TransportSender {
     /**
      * Field log
      */
@@ -44,7 +49,8 @@
     /**
      * Field NAME
      */
-    public static final QName NAME = new QName("http://axis.ws.apache.org", "TransportSender");
+    public static final QName NAME =
+        new QName("http://axis.ws.apache.org", "TransportSender");
 
     /**
      * Constructor AbstractTransportSender
@@ -65,7 +71,8 @@
         EndpointReference epr = null;
 
         if (msgContext.getTo() != null
-            && !AddressingConstants.EPR_ANONYMOUS_URL.equals(msgContext.getTo().getAddress())) {
+            && !AddressingConstants.EPR_ANONYMOUS_URL.equals(
+                msgContext.getTo().getAddress())) {
             epr = msgContext.getTo();
         }
 
@@ -75,35 +82,62 @@
             writeMessage(msgContext, out);
             finalizeSendWithToAddress(msgContext, out);
         } else {
-            out = (Writer) msgContext.getProperty(MessageContext.TRANSPORT_WRITER);
+            out =
+                (Writer) msgContext.getProperty(
+                    MessageContext.TRANSPORT_WRITER);
             if (out != null) {
-                startSendWithOutputStreamFromIncomingConnection(msgContext, out);
+                startSendWithOutputStreamFromIncomingConnection(
+                    msgContext,
+                    out);
                 writeMessage(msgContext, out);
-                finalizeSendWithOutputStreamFromIncomingConnection(msgContext, out);
+                finalizeSendWithOutputStreamFromIncomingConnection(
+                    msgContext,
+                    out);
             } else {
                 throw new AxisFault("Both the TO and Property MessageContext.TRANSPORT_WRITER is Null, No where to send");
             }
         }
     }
 
-    public void writeMessage(MessageContext msgContext, Writer out) throws AxisFault {
+    public void writeMessage(MessageContext msgContext, Writer out)
+        throws AxisFault {
         SOAPEnvelope envelope = msgContext.getEnvelope();
-        if (envelope != null) {
+        OMElement outputMessage = envelope;
+
+        //Check for the REST behaviour, if you desire rest beahaviour
+        //put a <parameter name="doREST" value="true"/> at the server.xml/client.xml file
+
+        Object doREST = msgContext.getProperty(Constants.DO_REST);
+        if (envelope != null
+            && doREST != null
+            && "true".equals(doREST)) {
+            outputMessage = envelope.getBody().getFirstElement();
+        }
+
+        if (outputMessage != null) {
             XMLStreamWriter outputWriter = null;
             try {
-                outputWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(out);
-                envelope.serialize(outputWriter);
+                outputWriter =
+                    XMLOutputFactory.newInstance().createXMLStreamWriter(out);
+                outputMessage.serialize(outputWriter);
                 outputWriter.flush();
                 out.flush();
+
             } catch (Exception e) {
                 throw new AxisFault("Stream error", e);
             }
+        } else {
+            throw new AxisFault("the OUTPUT message is Null, nothing to write");
         }
     }
 
-    public abstract void startSendWithToAddress(MessageContext msgContext, Writer writer)
+    public abstract void startSendWithToAddress(
+        MessageContext msgContext,
+        Writer writer)
         throws AxisFault;
-    public abstract void finalizeSendWithToAddress(MessageContext msgContext, Writer writer)
+    public abstract void finalizeSendWithToAddress(
+        MessageContext msgContext,
+        Writer writer)
         throws AxisFault;
 
     public abstract void startSendWithOutputStreamFromIncomingConnection(
@@ -115,5 +149,6 @@
         Writer writer)
         throws AxisFault;
 
-    protected abstract Writer openTheConnection(EndpointReference epr) throws AxisFault;
+    protected abstract Writer openTheConnection(EndpointReference epr)
+        throws AxisFault;
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/AxisServlet.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/AxisServlet.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/AxisServlet.java Sat May 21 08:23:10 2005
@@ -15,18 +15,11 @@
  */
 package org.apache.axis.transport.http;
 
-import org.apache.axis.Constants;
-import org.apache.axis.addressing.AddressingConstants;
-import org.apache.axis.addressing.EndpointReference;
-import org.apache.axis.context.ConfigurationContext;
-import org.apache.axis.context.ConfigurationContextFactory;
-import org.apache.axis.context.MessageContext;
-import org.apache.axis.context.SessionContext;
-import org.apache.axis.engine.AxisEngine;
-import org.apache.axis.engine.AxisFault;
-import org.apache.axis.om.impl.llom.builder.StAXBuilder;
-import org.apache.axis.soap.SOAPEnvelope;
-import org.apache.axis.soap.impl.llom.builder.StAXSOAPModelBuilder;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.HashMap;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
@@ -39,11 +32,24 @@
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.HashMap;
+
+import org.apache.axis.Constants;
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.context.ConfigurationContext;
+import org.apache.axis.context.ConfigurationContextFactory;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.context.SessionContext;
+import org.apache.axis.description.Parameter;
+import org.apache.axis.engine.AxisConfiguration;
+import org.apache.axis.engine.AxisEngine;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.impl.llom.builder.StAXBuilder;
+import org.apache.axis.om.impl.llom.builder.StAXOMBuilder;
+import org.apache.axis.soap.SOAPEnvelope;
+import org.apache.axis.soap.SOAPFactory;
+import org.apache.axis.soap.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Factory;
 
 /**
  * Class AxisServlet
@@ -52,20 +58,20 @@
     /**
      * Field engineRegistry
      */
-    
+
     private ConfigurationContext engineContext;
 
     /**
      * Field LIST_MULTIPLE_SERVICE_JSP_NAME
      */
     private static final String LIST_MULTIPLE_SERVICE_JSP_NAME =
-            "listServices.jsp";
+        "listServices.jsp";
 
     /**
      * Field LIST_SINGLE_SERVICE_JSP_NAME
      */
     private static final String LIST_SINGLE_SERVICE_JSP_NAME =
-            "listSingleService.jsp";
+        "listSingleService.jsp";
 
     /**
      * Field allowListServices
@@ -87,7 +93,8 @@
         try {
             ServletContext context = config.getServletContext();
             String repoDir = context.getRealPath("/WEB-INF");
-            ConfigurationContextFactory erfac = new ConfigurationContextFactory();
+            ConfigurationContextFactory erfac =
+                new ConfigurationContextFactory();
             engineContext = erfac.buildEngineContext(repoDir);
         } catch (Exception e) {
             throw new ServletException(e);
@@ -103,11 +110,13 @@
      * @throws IOException
      */
     protected void doGet(
-            HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
-            throws ServletException, IOException {
+        HttpServletRequest httpServletRequest,
+        HttpServletResponse httpServletResponse)
+        throws ServletException, IOException {
         String filePart = httpServletRequest.getRequestURL().toString();
-        if (allowListServices && (filePart != null)
-                && filePart.endsWith(Constants.LISTSERVICES)) {
+        if (allowListServices
+            && (filePart != null)
+            && filePart.endsWith(Constants.LISTSERVICES)) {
             listServices(httpServletRequest, httpServletResponse);
             return;
         } else {
@@ -132,40 +141,62 @@
      * @throws IOException
      */
     protected void doPost(HttpServletRequest req, HttpServletResponse res)
-            throws ServletException, IOException {
+        throws ServletException, IOException {
         try {
             res.setContentType("text/xml; charset=utf-8");
             AxisEngine engine = new AxisEngine(engineContext);
-            Object sessionContext = req.getSession().getAttribute(
+            Object sessionContext =
+                req.getSession().getAttribute(
                     Constants.SESSION_CONTEXT_PROPERTY);
             if (sessionContext == null) {
                 sessionContext = new SessionContext(null);
                 req.getSession().setAttribute(
-                        Constants.SESSION_CONTEXT_PROPERTY, sessionContext);
+                    Constants.SESSION_CONTEXT_PROPERTY,
+                    sessionContext);
             }
-            MessageContext msgContext = new MessageContext((SessionContext) sessionContext,
-                    engineContext.getEngineConfig().getTransportIn(new QName(Constants.TRANSPORT_HTTP)),
-                    engineContext.getEngineConfig().getTransportOut(new QName(Constants.TRANSPORT_HTTP)),engineContext);
+            MessageContext msgContext =
+                new MessageContext(
+                    (SessionContext) sessionContext,
+                    engineContext.getEngineConfig().getTransportIn(
+                        new QName(Constants.TRANSPORT_HTTP)),
+                    engineContext.getEngineConfig().getTransportOut(
+                        new QName(Constants.TRANSPORT_HTTP)),
+                    engineContext);
             msgContext.setServerSide(true);
             String filePart = req.getRequestURL().toString();
-            msgContext.setTo(new EndpointReference(AddressingConstants.WSA_TO,
-                            filePart));
+            msgContext.setTo(
+                new EndpointReference(AddressingConstants.WSA_TO, filePart));
             String soapActionString =
-                    req.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
+                req.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
             if (soapActionString != null) {
                 msgContext.setWSAAction(soapActionString);
             }
             XMLStreamReader reader =
-                    XMLInputFactory.newInstance().createXMLStreamReader(
+                XMLInputFactory.newInstance().createXMLStreamReader(
                     new BufferedReader(
-                            new InputStreamReader(req.getInputStream())));
-            StAXBuilder builder =
-            new StAXSOAPModelBuilder(reader);
-            msgContext.setEnvelope((SOAPEnvelope) builder.getDocumentElement());
+                        new InputStreamReader(req.getInputStream())));
+                        
+            //Check for the REST behaviour, if you desire rest beahaviour
+            //put a <parameter name="doREST" value="true"/> at the server.xml/client.xml file
+           Object doREST = msgContext.getProperty(Constants.DO_REST);
+            StAXBuilder builder = null;
+            SOAPEnvelope envelope = null;
+            if (doREST != null && "true".equals(doREST)) {
+                SOAPFactory soapFactory = new SOAP11Factory();
+                builder = new StAXOMBuilder(reader);
+                builder.setOmbuilderFactory(soapFactory);
+                envelope = soapFactory.getDefaultEnvelope();
+                envelope.getBody().addChild(builder.getDocumentElement());
+            } else {
+                builder = new StAXSOAPModelBuilder(reader);
+                envelope = (SOAPEnvelope) builder.getDocumentElement();
+            }
             
+            msgContext.setEnvelope(envelope);
 
-            msgContext.setProperty(MessageContext.TRANSPORT_WRITER,
-                    new BufferedWriter(res.getWriter()));
+            msgContext.setProperty(
+                MessageContext.TRANSPORT_WRITER,
+                new BufferedWriter(res.getWriter()));
             engine.receive(msgContext);
         } catch (AxisFault e) {
             throw new ServletException(e);
@@ -184,10 +215,12 @@
      * @throws IOException
      */
     private void listServices(HttpServletRequest req, HttpServletResponse res)
-            throws IOException {
+        throws IOException {
         HashMap services = engineContext.getEngineConfig().getServices();
         req.getSession().setAttribute(Constants.SERVICE_MAP, services);
-        req.getSession().setAttribute(Constants.ERROR_SERVICE_MAP, engineContext.getEngineConfig().getFaulytServices());
+        req.getSession().setAttribute(
+            Constants.ERROR_SERVICE_MAP,
+            engineContext.getEngineConfig().getFaulytServices());
         res.sendRedirect(LIST_MULTIPLE_SERVICE_JSP_NAME);
     }
 
@@ -200,16 +233,21 @@
      * @throws IOException
      */
     private void listService(
-            HttpServletRequest req, HttpServletResponse res, String filePart)
-            throws IOException {
-        String serviceName = filePart.substring(filePart.lastIndexOf("/") + 1,
+        HttpServletRequest req,
+        HttpServletResponse res,
+        String filePart)
+        throws IOException {
+        String serviceName =
+            filePart.substring(
+                filePart.lastIndexOf("/") + 1,
                 filePart.length());
         HashMap services = engineContext.getEngineConfig().getServices();
         if ((services != null) && !services.isEmpty()) {
             Object serviceObj = services.get(new QName(serviceName));
             if (serviceObj != null) {
-                req.getSession().setAttribute(Constants.SINGLE_SERVICE,
-                        serviceObj);
+                req.getSession().setAttribute(
+                    Constants.SINGLE_SERVICE,
+                    serviceObj);
             }
         }
         String URI = req.getRequestURI();

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportReceiver.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportReceiver.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/HTTPTransportReceiver.java Sat May 21 08:23:10 2005
@@ -23,20 +23,23 @@
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.axis.Constants;
 import org.apache.axis.addressing.AddressingConstants;
 import org.apache.axis.addressing.EndpointReference;
 import org.apache.axis.context.ConfigurationContext;
 import org.apache.axis.context.MessageContext;
-import org.apache.axis.engine.AxisEngine;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.om.impl.llom.builder.StAXBuilder;
+import org.apache.axis.om.impl.llom.builder.StAXOMBuilder;
 import org.apache.axis.soap.SOAPEnvelope;
+import org.apache.axis.soap.SOAPFactory;
 import org.apache.axis.soap.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Factory;
 
 /**
  * Class HTTPTransportReceiver
  */
-public class HTTPTransportReceiver  {
+public class HTTPTransportReceiver {
     /**
      * Field END
      */
@@ -88,22 +91,27 @@
      * @param msgContext
      * @throws AxisFault
      */
-    public SOAPEnvelope checkForResponse(MessageContext msgContext,ConfigurationContext engineContext) throws AxisFault{
+    public SOAPEnvelope checkForMessage(
+        MessageContext msgContext,
+        ConfigurationContext engineContext)
+        throws AxisFault {
         SOAPEnvelope soapEnvelope = null;
-        
-        Reader in = (Reader) msgContext.getProperty(MessageContext.TRANSPORT_READER);
+
+        Reader in =
+            (Reader) msgContext.getProperty(MessageContext.TRANSPORT_READER);
         if (in != null) {
             boolean serverSide = msgContext.isServerSide();
             Map map = parseTheHeaders(in, serverSide);
             if (serverSide) {
-                msgContext.setWSAAction((String)
-                    map.get(HTTPConstants.HEADER_SOAP_ACTION));
+                msgContext.setWSAAction(
+                    (String) map.get(HTTPConstants.HEADER_SOAP_ACTION));
 
                 String requestURI = (String) map.get(HTTPConstants.REQUEST_URI);
                 msgContext.setTo(
-                    new EndpointReference(AddressingConstants.WSA_TO,
+                    new EndpointReference(
+                        AddressingConstants.WSA_TO,
                         requestURI));
-                        //getServiceLookUp(requestURI)));
+                //getServiceLookUp(requestURI)));
 
                 // TODO see is it a Service request e.g. WSDL, list ....
                 // TODO take care of the other HTTPHeaders
@@ -121,9 +129,25 @@
             }
 
             try {
-                XMLStreamReader xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in);
-                StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader);
-                return (SOAPEnvelope) builder.getDocumentElement();
+                //Check for the REST behaviour, if you desire rest beahaviour
+                //put a <parameter name="doREST" value="true"/> at the server.xml/client.xml file
+                Object doREST = msgContext.getProperty(Constants.DO_REST);
+                XMLStreamReader xmlreader =
+                    XMLInputFactory.newInstance().createXMLStreamReader(in);
+                StAXBuilder builder = null;
+                SOAPEnvelope envelope = null;
+                if (doREST != null
+                    && "true".equals(doREST)) {
+                    SOAPFactory soapFactory = new SOAP11Factory();
+                    builder = new StAXOMBuilder(xmlreader);
+                    builder.setOmbuilderFactory(soapFactory);
+                    envelope = soapFactory.getDefaultEnvelope();
+                    envelope.getBody().addChild(builder.getDocumentElement());
+                } else {
+                    builder = new StAXSOAPModelBuilder(xmlreader);
+                    envelope = (SOAPEnvelope) builder.getDocumentElement();
+                }
+                return envelope;
             } catch (Exception e) {
                 throw new AxisFault(e.getMessage(), e);
             }
@@ -155,7 +179,8 @@
      * @return
      * @throws AxisFault
      */
-    public HashMap parseTheHeaders(Reader reader, boolean serverSide) throws AxisFault {
+    public HashMap parseTheHeaders(Reader reader, boolean serverSide)
+        throws AxisFault {
         HashMap map = new HashMap();
         try {
             StringBuffer str = new StringBuffer();
@@ -165,7 +190,10 @@
             int start = 0;
             length = readLine(reader, buf);
             if (serverSide) {
-                if ((buf[0] == 'P') && (buf[1] == 'O') && (buf[2] == 'S') && (buf[3] == 'T')) {
+                if ((buf[0] == 'P')
+                    && (buf[1] == 'O')
+                    && (buf[2] == 'S')
+                    && (buf[3] == 'T')) {
                     index = 5;
                     value = readFirstLineArg(' ');
                     map.put(HTTPConstants.REQUEST_URI, value);
@@ -226,7 +254,8 @@
                             // case END:
                             // break;
                         default :
-                            throw new AxisFault("Error Occured Unknown state " + state);
+                            throw new AxisFault(
+                                "Error Occured Unknown state " + state);
                     }
                 }
                 state = BEFORE_SEPERATOR;
@@ -416,18 +445,18 @@
         }
     }
 
-//    private String getServiceLookUp(String requestURI) throws AxisFault {
-//        final String URI_ID_STRING = "/services";
-//              String filePart = requestURI;
-//
-//              int index = filePart.lastIndexOf(URI_ID_STRING);
-//              String serviceStr = null;
-//              if (index > 0) {
-//                  serviceStr = filePart.substring(index + URI_ID_STRING.length() + 1);
-//                  return serviceStr;
-//
-//              } else {
-//                  throw new AxisFault("Both the URI and SOAP_ACTION are Null");
-//              }
-//    }
+    //    private String getServiceLookUp(String requestURI) throws AxisFault {
+    //        final String URI_ID_STRING = "/services";
+    //              String filePart = requestURI;
+    //
+    //              int index = filePart.lastIndexOf(URI_ID_STRING);
+    //              String serviceStr = null;
+    //              if (index > 0) {
+    //                  serviceStr = filePart.substring(index + URI_ID_STRING.length() + 1);
+    //                  return serviceStr;
+    //
+    //              } else {
+    //                  throw new AxisFault("Both the URI and SOAP_ACTION are Null");
+    //              }
+    //    }
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/SimpleHTTPServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/SimpleHTTPServer.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/SimpleHTTPServer.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/SimpleHTTPServer.java Sat May 21 08:23:10 2005
@@ -15,6 +15,16 @@
  */
 package org.apache.axis.transport.http;
 
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+import javax.xml.namespace.QName;
+
 import org.apache.axis.Constants;
 import org.apache.axis.addressing.AddressingConstants;
 import org.apache.axis.addressing.EndpointReference;
@@ -24,16 +34,10 @@
 import org.apache.axis.description.TransportOutDescription;
 import org.apache.axis.engine.AxisEngine;
 import org.apache.axis.engine.AxisFault;
-import org.apache.axis.soap.SOAPEnvelope;
 import org.apache.axis.transport.TransportListener;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.xml.namespace.QName;
-import java.io.*;
-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
@@ -148,7 +152,7 @@
                         msgContext.setProperty(MessageContext.TRANSPORT_WRITER, out);
                         msgContext.setProperty(MessageContext.TRANSPORT_READER, in);
                         HTTPTransportReceiver reciver = new HTTPTransportReceiver();
-                        msgContext.setEnvelope(reciver.checkForResponse(msgContext, configurationContext));
+                        msgContext.setEnvelope(reciver.checkForMessage(msgContext, configurationContext));
                         
                         AxisEngine engine = new AxisEngine(configurationContext);
                         engine.receive(msgContext);

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/tcp/TCPTransportSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/tcp/TCPTransportSender.java?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/tcp/TCPTransportSender.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/tcp/TCPTransportSender.java Sat May 21 08:23:10 2005
@@ -58,7 +58,6 @@
     public void finalizeSendWithOutputStreamFromIncomingConnection(
         MessageContext msgContext,
         Writer writer) {
-        throw new UnsupportedOperationException();
     }
 
     public void finalizeSendWithToAddress(MessageContext msgContext, Writer writer)
@@ -94,7 +93,6 @@
         MessageContext msgContext,
         Writer writer)
         throws AxisFault {
-        throw new UnsupportedOperationException();
     }
 
     public void startSendWithToAddress(MessageContext msgContext, Writer writer) {

Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/context/ContextHireachyTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/context/ContextHireachyTest.java?rev=171224&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/context/ContextHireachyTest.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/context/ContextHireachyTest.java Sat May 21 08:23:10 2005
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2004,2005 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.context;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.description.OperationDescription;
+import org.apache.axis.description.ParameterImpl;
+import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.engine.AxisConfiguration;
+import org.apache.axis.engine.AxisConfigurationImpl;
+import org.apache.axis.engine.AxisFault;
+
+import junit.framework.TestCase;
+
+/**
+ * @author srinath
+ *
+ * To change the template for this generated type comment go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+public class ContextHireachyTest extends TestCase {
+    private OperationDescription operationDescription;
+    private ServiceDescription serviceDescription;
+    private AxisConfiguration axisConfiguration;
+
+    public ContextHireachyTest(String arg0) {
+        super(arg0);
+    }
+
+    protected void setUp() throws Exception {
+        operationDescription = new OperationDescription(new QName("Temp"));
+        serviceDescription = new ServiceDescription(new QName("Temp"));
+        axisConfiguration = new AxisConfigurationImpl();
+        serviceDescription.addOperation(operationDescription);
+        axisConfiguration.addService(serviceDescription);
+    }
+
+    public void testCompleteHiracy() throws AxisFault {
+        ConfigurationContext configurationContext =
+            new ConfigurationContext(axisConfiguration);
+        ServiceContext serviceCOntext =
+            configurationContext.createServiceContext(
+                serviceDescription.getName());
+        MessageContext msgctx =
+            new MessageContext(null, null, null, configurationContext);
+        OperationContext opContext =
+            operationDescription.findOperationContext(
+                msgctx,
+                serviceCOntext,
+                true);
+        msgctx.setServiceContext(serviceCOntext);
+
+        //test the complte Hisracy built
+        assertEquals(msgctx.getParent(), opContext);
+        assertEquals(opContext.getParent(), serviceCOntext);
+        assertEquals(serviceCOntext.getParent(), configurationContext);
+
+        String key1 = "key1";
+        String value1 = "Val1";
+        String value2 = "value2";
+        String key2 = "key2";
+        String value3 = "value";
+
+        configurationContext.setProperty(key1, value1);
+        assertEquals(value1, msgctx.getProperty(key1));
+
+        axisConfiguration.addParameter(new ParameterImpl(key2, value2));
+        assertEquals(value2, msgctx.getProperty(key2));
+
+        opContext.setProperty(key1, value3);
+        assertEquals(value3, msgctx.getProperty(key1));
+
+    }
+
+    public void testDisconntectedHiracy() throws AxisFault {
+        ConfigurationContext configurationContext =
+            new ConfigurationContext(axisConfiguration);
+  
+        MessageContext msgctx =
+            new MessageContext(null, null, null, configurationContext);
+  
+        //test the complte Hisracy built
+        assertEquals(msgctx.getParent(), null);
+
+        String key1 = "key1";
+        String value1 = "Val1";
+        String value2 = "value2";
+        String key2 = "key2";
+        String value3 = "value";
+
+        configurationContext.setProperty(key1, value1);
+        assertEquals(value1, msgctx.getProperty(key1));
+
+        axisConfiguration.addParameter(new ParameterImpl(key2, value2));
+        assertEquals(value2, msgctx.getProperty(key2));
+    }
+
+    protected void tearDown() throws Exception {
+    }
+
+}

Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/transport/sample.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/transport/sample.xml?rev=171224&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/transport/sample.xml (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/transport/sample.xml Sat May 21 08:23:10 2005
@@ -0,0 +1,15 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
+    <soapenv:Header>
+        <wsa:MessageID soapenv:mustUnderstand="0">uuid:920C5190-0B8F-11D9-8CED-F22EDEEBF7E5</wsa:MessageID>
+        <wsa:To soapenv:mustUnderstand="0">http://localhost:8081/axis/services/BankPort</wsa:To>
+        <wsa:From soapenv:mustUnderstand="0">
+            <wsa:Address>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:Address>
+        </wsa:From>
+        <wsa:Action>http://ws.apache.org/tests/action</wsa:Action>
+    </soapenv:Header>
+    <soapenv:Body>
+        <ns1:getBalance soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://localhost:8081/axis/services/BankPort">
+            <accountNo>234</accountNo>
+        </ns1:getBalance>
+    </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file

Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/transport/tcp/TCPTransportTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/transport/tcp/TCPTransportTest.java?rev=171224&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/transport/tcp/TCPTransportTest.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/transport/tcp/TCPTransportTest.java Sat May 21 08:23:10 2005
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2004,2005 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.transport.tcp;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import junit.framework.TestCase;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.context.ConfigurationContext;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.description.OperationDescription;
+import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.engine.AxisConfiguration;
+import org.apache.axis.engine.AxisConfigurationImpl;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.impl.llom.builder.StAXBuilder;
+import org.apache.axis.soap.SOAPEnvelope;
+import org.apache.axis.soap.impl.llom.builder.StAXSOAPModelBuilder;
+
+public class TCPTransportTest extends TestCase {
+    public TCPTransportTest(String arg0) {
+        super(arg0);
+        // TODO Auto-generated constructor stub
+    }
+
+    public void testTransportSender() throws AxisFault {
+//        Thread thead = new Thread(new Runnable() {
+//            public void run() {
+//               try {
+//                     ServerSocket serverSocket = new ServerSocket(45678);
+//                        Socket s = serverSocket.accept();
+//                        assertNotNull(createSOAPEnvelope(s.getInputStream()));
+//                } catch (AxisFault e) {
+//                    // TODO Auto-generated catch block
+//                    e.printStackTrace();
+//                } catch (IOException e) {
+//                    // TODO Auto-generated catch block
+//                    e.printStackTrace();
+//                }
+//            }
+//        });
+//        thead.start();
+//
+//        TCPTransportSender ts = new TCPTransportSender();
+//        MessageContext msgctx = new MessageContext(null, null, null, null);
+//        msgctx.setTo(new EndpointReference(AddressingConstants.WSA_TO,"http://127.0.0.1:45679"));
+//        
+//        msgctx.setEnvelope(createSOAPEnvelope(Thread.currentThread().getContextClassLoader().getResourceAsStream("org/apache/axis/transport/sample.xml")));
+//        ts.invoke(msgctx);
+        
+
+    }
+    
+//    public void testTransportReciver(){
+//        ConfigurationContext configContext = new ConfigurationContext(new AxisConfigurationImpl());
+//        ServiceDescription serviceDesc = new ServiceDescription(new QName("TempService"));
+//        OperationDescription opDesc = new OperationDescription();
+//        TCPServer tcpServer = new TCPServer();
+//    }
+    
+
+    public SOAPEnvelope createSOAPEnvelope(InputStream in) throws AxisFault {
+        try {
+            XMLStreamReader xmlreader =
+                XMLInputFactory.newInstance().createXMLStreamReader(in);
+            StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader);
+            return (SOAPEnvelope) builder.getDocumentElement();
+        } catch (Exception e) {
+            throw new AxisFault(e.getMessage(), e);
+        }
+    }
+
+}

Modified: webservices/axis/trunk/java/modules/samples/build.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/build.xml?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/build.xml (original)
+++ webservices/axis/trunk/java/modules/samples/build.xml Sat May 21 08:23:10 2005
@@ -10,7 +10,7 @@
                                                                      
      ====================================================================== -->
 <project name="samples" basedir="." default="compile">
-	<property name="src.dir" value="src/java" />
+	<property name="src.dir" value="src" />
 	<property name="build.dir" value="build" />
 	<property name="lib.dir" value="${build.dir}/lib" />
 	<property name="classes.dir" value="./classes" />

Modified: webservices/axis/trunk/java/modules/samples/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/project.xml?rev=171224&r1=171223&r2=171224&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/project.xml (original)
+++ webservices/axis/trunk/java/modules/samples/project.xml Sat May 21 08:23:10 2005
@@ -123,7 +123,7 @@
         <exclude>**/*Abstract*.java</exclude>
 	    <exclude>**/*Util*.java</exclude>
 		<exclude>**/*InteropStubTest.java</exclude>
-		<exclude>**/*TCPEchoRawXMLTest.java</exclude>
+		<!-- <exclude>**/*TCPEchoRawXMLTest.java</exclude> -->
       </excludes>
      <includes>
         <include>**/*Test.java</include>
@@ -140,7 +140,7 @@
         		</includes>
       </resource>
       <resource>
-        <directory>src/java</directory>
+        <directory>src</directory>
         <includes>
           	<include>**/*.properties</include>
           	<include>**/*.xml</include>
@@ -157,7 +157,7 @@
         </includes>
       </resource>
       <resource>
-        <directory>src/java</directory>
+        <directory>src</directory>
         <includes>
           <include>**/*.properties</include>
           <include>**/*.xml</include>



Mime
View raw message