axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hemap...@apache.org
Subject svn commit: r168116 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis/clientapi/ core/src/org/apache/axis/context/ core/src/org/apache/axis/deployment/ core/src/org/apache/axis/description/ core/src/org/apache/axis/engine/ core/src/org/apache/axis/util/ core/test/org/apache/axis/engine/ samples/test/org/apache/axis/clientapi/ samples/test/org/apache/axis/engine/
Date Wed, 04 May 2005 11:36:44 GMT
Author: hemapani
Date: Wed May  4 04:36:42 2005
New Revision: 168116

URL: http://svn.apache.org/viewcvs?rev=168116&view=rev
Log:
EchoXMLtest still keep failing, checking in the changes

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Call.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/ListenerManager.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.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/DeploymentEngine.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AddressingBasedDispatcher.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/util/Utils.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceive.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceiveAsync.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/HandlerFailureTest.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MessageWithServerTest.java

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=168116&r1=168115&r2=168116&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 Wed May
 4 04:36:42 2005
@@ -12,6 +12,7 @@
 import org.apache.axis.context.BasicMEPContext;
 import org.apache.axis.context.EngineContext;
 import org.apache.axis.context.MessageContext;
+import org.apache.axis.context.ServiceContext;
 import org.apache.axis.description.AxisGlobal;
 import org.apache.axis.description.AxisOperation;
 import org.apache.axis.description.AxisService;
@@ -49,6 +50,7 @@
     private AxisService callbackService;
     private CallbackReceiver callbackReceiver;
     private AxisOperation axisOperation;
+    private ListenerManager listenerManager;
 
     public Call() throws AxisFault {
         this(new EngineContext(new EngineConfigurationImpl(new AxisGlobal())));
@@ -79,7 +81,6 @@
             registry.addTransportOut(mailTransportOut);
 
             messageInfoHeaders = new MessageInformationHeadersCollection();
-            init();
         } catch (ClassNotFoundException e) {
             throw new AxisFault(e.getMessage(), e);
         } catch (InstantiationException e) {
@@ -93,6 +94,8 @@
         messageInfoHeaders = new MessageInformationHeadersCollection();
         this.properties = new HashMap();
         this.engineContext = engineContext;
+        callbackReceiver = new CallbackReceiver();
+        listenerManager = new ListenerManager(engineContext);
         if (wsdlDesc != null) {
 
         }
@@ -103,9 +106,7 @@
     }
 
     public void sendReceiveAsync(SOAPEnvelope env, final Callback callback) throws AxisFault
{
-        if (axisOperation == null) {
-            throw new AxisFault("Operation Name must be specified");
-        }
+        initializeOperation();
 
         EngineConfiguration registry = engineContext.getEngineConfig();
         if (Constants.TRANSPORT_MAIL.equals(senderTransport)) {
@@ -121,11 +122,11 @@
             final MessageContext msgctx =
                 new MessageContext(
                     engineContext,
-                    null,
+                    properties,
                     null,
                     transportIn,
-                    transportOut,
-                    new BasicMEPContext(axisOperation, null));
+                    transportOut);
+                    
 
             msgctx.setEnvelope(env);
 
@@ -133,7 +134,7 @@
                 messageInfoHeaders.setMessageId(String.valueOf(System.currentTimeMillis()));
                 callbackReceiver.addCallback(messageInfoHeaders.getMessageId(), callback);
                 messageInfoHeaders.setReplyTo(
-                    ListenerManager.replyToEPR(
+                listenerManager.replyToEPR(
                         callbackService.getName().getLocalPart()
                             + "/"
                             + axisOperation.getName().getLocalPart()));
@@ -175,9 +176,7 @@
     }
 
     public SOAPEnvelope sendReceiveSync(SOAPEnvelope env) throws AxisFault {
-        if (axisOperation == null) {
-            throw new AxisFault("Operation Name must be specified");
-        }
+        initializeOperation();
 
         EngineConfiguration registry = engineContext.getEngineConfig();
         if (Constants.TRANSPORT_MAIL.equals(senderTransport)) {
@@ -192,7 +191,7 @@
             MessageContext msgctx =
                 new MessageContext(
                     engineContext,
-                    null,
+                    properties,
                     null,
                     transportIn,
                     transportOut,
@@ -236,31 +235,8 @@
         return properties.get(key);
     }
 
- 
-
-    /**
-     * This method is used to initilize the client side ,
-     */
-    private void init() throws AxisFault {
-
-//        AxisService callbackService = new AxisService();
-//        callbackServiceName = CallbackReceiver.SERVIC_NAME + System.currentTimeMillis();
-//        callbackService.setName(new QName(callbackServiceName));
-//        callbackReceiver = new CallbackReceiver();
-//        callbackService.setMessageReceiver(callbackReceiver);
-//
-//        replyToOpName = new QName("callback_op");
-//        callbackOperation = new AxisOperation(replyToOpName);
-//        callbackService.addOperation(callbackOperation);
-//
-//        ListenerManager.makeSureStarted();
-//
-//        ListenerManager.getEngineContext().addService(new ServiceContext(callbackService,
null));
-
-    }
-
     public void close() {
-        ListenerManager.stopAServer();
+        listenerManager.stopAServer();
     }
 
  
@@ -340,10 +316,20 @@
      */
     public void setOperationName(QName name) {
         axisOperation = new AxisOperation(name);
+        messageInfoHeaders.setAction(axisOperation.getName().getLocalPart());
     }
-
-    public void setEndPointURL(String URL) {
-
+    
+    private void initializeOperation() throws AxisFault{
+        if (axisOperation == null) {
+             throw new AxisFault("Operation Name must be specified");
+         } 
+         
+         if(callbackService == null){
+             callbackService = new AxisService(new QName("CallBackService"));
+         } 
+        callbackService.addOperation(axisOperation);
+        axisOperation.setMessageReciever(callbackReceiver);
+        listenerManager.makeSureStarted();
+        listenerManager.getEngineContext().addService(new ServiceContext(callbackService,
null));
     }
-
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/ListenerManager.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/ListenerManager.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/ListenerManager.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/ListenerManager.java
Wed May  4 04:36:42 2005
@@ -22,24 +22,25 @@
 import org.apache.axis.addressing.AddressingConstants;
 import org.apache.axis.addressing.EndpointReference;
 import org.apache.axis.context.EngineContext;
-import org.apache.axis.description.AxisGlobal;
 import org.apache.axis.engine.AxisFault;
-import org.apache.axis.engine.EngineConfigurationImpl;
 import org.apache.axis.transport.http.SimpleHTTPServer;
 
 public class ListenerManager {
-    private static EngineContext engineContext;
-    private static boolean started = false;
-    private static int numberOfserver = 0;
-    private static SimpleHTTPServer simpleHttpServer;
-    private static ServerSocket scoket;
+    private EngineContext engineContext;
+    private boolean started = false;
+    private int numberOfserver = 0;
+    private SimpleHTTPServer simpleHttpServer;
+    private ServerSocket scoket;
 
-    public static void makeSureStarted() throws AxisFault {
+    public ListenerManager(EngineContext engineContext) {
+        this.engineContext = engineContext;
+    }
+
+    public void makeSureStarted() throws AxisFault {
         synchronized (ListenerManager.class) {
             try {
                 if (started == false) {
-                    engineContext =
-                        new EngineContext(new EngineConfigurationImpl(new AxisGlobal()));
+
                     scoket = new ServerSocket(6060);
                     simpleHttpServer = new SimpleHTTPServer(engineContext, scoket);
                     simpleHttpServer.start();
@@ -56,18 +57,27 @@
     /**
      * @return
      */
-    public static EngineContext getEngineContext() {
+    public EngineContext getEngineContext() {
         return engineContext;
     }
 
-    public static void stopAServer() {
+    public void stopAServer() {
         numberOfserver--;
         if (numberOfserver == 0) {
             simpleHttpServer.stop();
         }
     }
-    
-    public static EndpointReference replyToEPR(String serviceName){
-        return new EndpointReference(AddressingConstants.WSA_REPLY_TO,"http://127.0.0.1:"+
(scoket.getLocalPort())+"/axis/services/"+serviceName);
+
+    public EndpointReference replyToEPR(String serviceName) {
+        return new EndpointReference(
+            AddressingConstants.WSA_REPLY_TO,
+            "http://127.0.0.1:" + (scoket.getLocalPort() + 1) + "/axis/services/" + serviceName);
+    }
+    /**
+     * @param context
+     */
+    public void setEngineContext(EngineContext context) {
+        engineContext = context;
     }
+
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContext.java
Wed May  4 04:36:42 2005
@@ -135,10 +135,12 @@
     
     
     public void addMEPContext(String messageID, MEPContext mepContext){
+        System.out.println(messageID);
     	this.mepContextMap.put(messageID, mepContext);
     }
     
     public MEPContext getMEPContext(String messageID){
+        System.out.println(messageID);
     	return(MEPContext)this.mepContextMap.get(messageID);
     }
      

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=168116&r1=168115&r2=168116&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
Wed May  4 04:36:42 2005
@@ -248,7 +248,7 @@
      * @return
      */
     public String getMessageID() {
-        return messageID;
+        return messageInformationHeaders.getMessageId();
     }
 
     /**
@@ -340,7 +340,7 @@
      * @param string
      */
     public void setMessageID(String string) {
-        messageID = string;
+        messageInformationHeaders.setMessageId(string);
     }
 
     /**

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
Wed May  4 04:36:42 2005
@@ -46,7 +46,6 @@
 import org.apache.axis.engine.EngineConfiguration;
 import org.apache.axis.engine.EngineConfigurationImpl;
 import org.apache.axis.engine.Handler;
-import org.apache.axis.engine.MessageReceiver;
 import org.apache.axis.modules.Module;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -301,7 +300,6 @@
      * @throws AxisFault
      */
     private void loadServiceProperties(AxisService axisService) throws AxisFault {
-        loadMessageReceiver(axisService);
         Flow inflow = axisService.getInFlow();
         if (inflow != null) {
             addFlowHandlers(inflow);
@@ -325,21 +323,7 @@
     }
 
 
-    private void loadMessageReceiver(AxisService service) throws AxisFault {
-        Class messageReceiver = null;
-        ClassLoader loader1 = currentFileItem.getClassLoader();
-        try {
-            service.setClassLoader(loader1);
-            String readInClass = currentFileItem.getMessgeReceiver();
-            if (readInClass != null && !"".equals(readInClass)) {
-                messageReceiver = Class.forName(readInClass, true, loader1);
-                service.setMessageReceiver((MessageReceiver) messageReceiver.newInstance());
-            }
-        } catch (Exception e) {
-            throw new AxisFault(e.getMessage(), e);
-        }
-
-    }
+ 
 
     private void loadModuleClass(AxisModule module) throws AxisFault {
         Class moduleClass = null;

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisService.java
Wed May  4 04:36:42 2005
@@ -21,7 +21,6 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.axis.engine.MessageReceiver;
 import org.apache.wsdl.WSDLService;
 import org.apache.wsdl.impl.WSDLServiceImpl;
 
@@ -182,32 +181,7 @@
         return (String) this.getComponentProperty(CONTEXTPATH_KEY);
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.apache.axis.description.AxisService#setProvider(org.apache.axis.engine.Provider)
-     */
-
-    public void setMessageReceiver(MessageReceiver receiver) {
-        if (receiver != null) {
-            this.setComponentProperty(MESSAGE_RECIVER_KEY, receiver);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see org.apache.axis.description.AxisService#getProvider()
-     */
-
-    /**
-     * Method getProvider
-     *
-     * @return
-     */
-    public MessageReceiver getMessageReceiver() {
-        return (MessageReceiver) this.getComponentProperty(MESSAGE_RECIVER_KEY);
-    }
-
-    /*
+     /*
      * (non-Javadoc)
      * @see org.apache.axis.description.AxisService#setStyle(javax.swing.text.Style)
      */

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=168116&r1=168115&r2=168116&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
Wed May  4 04:36:42 2005
@@ -82,7 +82,9 @@
                 AxisOperation op = service.getOperation(operationName);
                 if (op != null) {
                     msgctx.setOperationConfig(op);
-                } 
+                } else{
+                    throw new AxisFault("No Operation named "+ operationName + " Not found"
);
+                }
                 //if no operation found let it go, this is for a handler may be. e.g. Create
Sequance in RM
             } else {
                 throw new AxisFault("Operation not found, WSA Action is Null");

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java Wed
May  4 04:36:42 2005
@@ -177,10 +177,7 @@
             if (context.isServerSide()) {
                 // add invoke Phase
                 MessageReceiver reciver =
-                    context
-                        .getServiceContext()
-                        .getServiceConfig()
-                        .getMessageReceiver();
+                    context.getoperationConfig().getMessageReciever();
                 reciver.recieve(context);
             }
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/util/Utils.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/util/Utils.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/util/Utils.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/util/Utils.java Wed May 
4 04:36:42 2005
@@ -22,6 +22,7 @@
 import org.apache.axis.Constants;
 import org.apache.axis.context.EngineContext;
 import org.apache.axis.context.ServiceContext;
+import org.apache.axis.description.AxisOperation;
 import org.apache.axis.description.AxisService;
 import org.apache.axis.description.Flow;
 import org.apache.axis.description.HandlerMetadata;
@@ -77,14 +78,16 @@
     public static AxisService createSimpleService(
         QName serviceName,
         MessageReceiver messageReceiver,
-        String className) {
+        String className, QName opName) {
         AxisService service = new AxisService(serviceName);
         service.setClassLoader(Thread.currentThread().getContextClassLoader());
         service.addParameter(
             new ParameterImpl(
                 AbstractMessageReceiver.SERVICE_CLASS,
             className));
-        service.setMessageReceiver(messageReceiver);
+        AxisOperation axisOp = new AxisOperation(opName);
+        axisOp.setMessageReciever(messageReceiver);
+        service.addOperation(axisOp);
         return service;
     }
     
@@ -95,8 +98,8 @@
     }
 
     public static AxisService createSimpleService(
-         QName serviceName, String className) {
-             return createSimpleService(serviceName,new RawXMLINOutMessageRecevier(),className);
  
+         QName serviceName, String className,QName opName) {
+             return createSimpleService(serviceName,new RawXMLINOutMessageRecevier(),className,opName);
  
      }
 
     public static void addHandlers(Flow flow, SimplePhase phase)

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java
(original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java
Wed May  4 04:36:42 2005
@@ -32,9 +32,8 @@
 import org.apache.axis.description.AxisTransportIn;
 import org.apache.axis.description.AxisTransportOut;
 import org.apache.axis.handlers.AbstractHandler;
-import org.apache.axis.om.OMFactory;
-import org.apache.axis.om.SOAPFactory;
 import org.apache.axis.om.OMAbstractFactory;
+import org.apache.axis.om.SOAPFactory;
 import org.apache.wsdl.WSDLService;
 
 public class EnginePausingTest extends AbstractEngineTest {
@@ -66,7 +65,7 @@
         SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
         mc.setEnvelope(omFac.getDefaultEnvelope());
         AxisService service = new AxisService(serviceName);
-        service.setMessageReceiver(new NullMessageReceiver());
+        axisOp.setMessageReciever(new NullMessageReceiver());
         
 
         service.addOperation(axisOp);

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java
(original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EngineWithoutPhaseResolvingTest.java
Wed May  4 04:36:42 2005
@@ -73,7 +73,7 @@
         SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
         mc.setEnvelope(omFac.getDefaultEnvelope());
         service = new AxisService(serviceName);
-        service.setMessageReceiver(new NullMessageReceiver());
+        axisOp.setMessageReciever(new NullMessageReceiver());
         engineRegistry.addService(service);
         service.setStyle(WSDLService.STYLE_DOC);
         service.addOperation(axisOp);

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceive.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceive.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceive.java
(original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceive.java
Wed May  4 04:36:42 2005
@@ -67,10 +67,9 @@
         service =
             Utils.createSimpleService(
                 serviceName,
-                org.apache.axis.engine.Echo.class.getName());
+                org.apache.axis.engine.Echo.class.getName(),operationName);
 
-        AxisOperation operation = new AxisOperation(operationName);
-        service.addOperation(operation);
+       
 
         UtilServer.start();
         UtilServer.deployService(Utils.createServiceContext(service,null));

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceiveAsync.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceiveAsync.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceiveAsync.java
(original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/clientapi/TestSendReceiveAsync.java
Wed May  4 04:36:42 2005
@@ -79,10 +79,9 @@
         service =
             Utils.createSimpleService(
                 serviceName,
-                org.apache.axis.engine.Echo.class.getName());
+                org.apache.axis.engine.Echo.class.getName(),operationName);
 
-        AxisOperation operation = new AxisOperation(operationName);
-        service.addOperation(operation);
+        
 
         UtilServer.start();
         UtilServer.deployService(Utils.createServiceContext(service,null));

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java
(original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java
Wed May  4 04:36:42 2005
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 package org.apache.axis.engine;
 
 //todo
@@ -24,23 +24,30 @@
 
 import junit.framework.TestCase;
 
-import org.apache.axis.Constants;
 import org.apache.axis.addressing.AddressingConstants;
 import org.apache.axis.addressing.EndpointReference;
 import org.apache.axis.clientapi.AsyncResult;
 import org.apache.axis.clientapi.Callback;
 import org.apache.axis.context.MessageContext;
-import org.apache.axis.description.AxisOperation;
 import org.apache.axis.description.AxisService;
 import org.apache.axis.integration.UtilServer;
-import org.apache.axis.om.*;
+import org.apache.axis.om.OMAbstractFactory;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.SOAPEnvelope;
+import org.apache.axis.om.SOAPFactory;
 import org.apache.axis.transport.http.SimpleHTTPServer;
 import org.apache.axis.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 public class EchoRawXMLTest extends TestCase {
-    private EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO,
"http://127.0.0.1:" + (UtilServer.TESTING_PORT) + "/axis/services/EchoXMLService/echoOMElement");
+    private EndpointReference targetEPR =
+        new EndpointReference(
+            AddressingConstants.WSA_TO,
+            "http://127.0.0.1:"
+                + (UtilServer.TESTING_PORT+1)
+                + "/axis/services/EchoXMLService/echoOMElement");
     private Log log = LogFactory.getLog(getClass());
     private QName serviceName = new QName("EchoXMLService");
     private QName operationName = new QName("echoOMElement");
@@ -63,26 +70,25 @@
 
     protected void setUp() throws Exception {
         UtilServer.start();
-        AxisService service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName());
-        AxisOperation operation = new AxisOperation(operationName);
-        service.addOperation(operation);
-        UtilServer.deployService(Utils.createServiceContext(service,null));
+        AxisService service =
+            Utils.createSimpleService(
+                serviceName,
+                org.apache.axis.engine.Echo.class.getName(),
+                operationName);
+        UtilServer.deployService(Utils.createServiceContext(service, null));
     }
 
-
     protected void tearDown() throws Exception {
         UtilServer.unDeployService(serviceName);
         UtilServer.stop();
     }
 
-
-
     private SOAPEnvelope createEnvelope(SOAPFactory fac) {
         SOAPEnvelope reqEnv = fac.getDefaultEnvelope();
         OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
         OMElement method = fac.createOMElement("echoOMElement", omNs);
         OMElement value = fac.createOMElement("myValue", omNs);
-        value.addChild(fac.createText(value,"Isaac Assimov, the foundation Sega"));
+        value.addChild(fac.createText(value, "Isaac Assimov, the foundation Sega"));
         method.addChild(value);
         reqEnv.getBody().addChild(method);
         return reqEnv;
@@ -97,12 +103,13 @@
 //
 //        call.setTo(targetEPR);
 //        call.setListenerTransport("http", false);
+//        call.setOperationName(operationName);
 //
 //        Callback callback = new Callback() {
 //            public void onComplete(AsyncResult result) {
 //                try {
-//                    result.getResponseEnvelope().serializeWithCache(XMLOutputFactory.newInstance()
-//                            .createXMLStreamWriter(System.out));
+//                    result.getResponseEnvelope().serializeWithCache(
+//                        XMLOutputFactory.newInstance().createXMLStreamWriter(System.out));
 //                } catch (XMLStreamException e) {
 //                    reportError(e);
 //                } finally {
@@ -123,9 +130,9 @@
 //
 //        log.info("send the reqest");
 //    }
-    
-//    public void testEchoXMLASync() throws Exception {
-//        OMFactory fac = OMFactory.newInstance();
+//
+//    public void testEchoXMLSync() throws Exception {
+//        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
 //
 //        SOAPEnvelope reqEnv = createEnvelope(fac);
 //
@@ -133,75 +140,53 @@
 //
 //        call.setTo(targetEPR);
 //        call.setListenerTransport("http", false);
-//        call.setOpName(operationName);
-//        Callback callback = new Callback() {
-//            public void onComplete(AsyncResult result) {
-//                try {
-//                    result.getResponseEnvelope().serializeWithCache(XMLOutputFactory.newInstance()
-//                            .createXMLStreamWriter(System.out));
-//                } catch (XMLStreamException e) {
-//                    reportError(e);
-//                } finally {
-//                    finish = true;
-//                }
-//            }
-//
-//            public void reportError(Exception e) {
-//                e.printStackTrace();
-//                finish = true;
-//            }
-//        };
-//
-//        call.sendReceiveAsync(reqEnv, callback);
-//        while (!finish) {
-//            Thread.sleep(1000);
-//        }
+//        call.setOperationName(operationName);
 //
-//        log.info("send the reqest");
+//        SOAPEnvelope result = call.sendReceiveSync(reqEnv);
+//        result.serializeWithCache(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out));
 //    }
-//    
-
+    //    
 
-    public void testEchoXMLCompleteASync() throws Exception {
-        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
-                                      
-            SOAPEnvelope reqEnv = fac.getDefaultEnvelope();
-            OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
-            OMElement method = fac.createOMElement("echoOMElement", omNs);
-            OMElement value = fac.createOMElement("myValue", omNs);
-            value.setText("Isaac Assimov, the foundation Sega");
-            method.addChild(value);
-            reqEnv.getBody().addChild(method);
-
-            org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
-
-            call.setTo(targetEPR);
-            call.setListenerTransport("http", true);
-            call.setOperationName(operationName);
-            Callback callback = new Callback() {
-                public void onComplete(AsyncResult result) {
-                    try {
-                        result.getResponseEnvelope().serialize(XMLOutputFactory.newInstance()
-                                .createXMLStreamWriter(System.out));
-                    } catch (XMLStreamException e) {
-                        reportError(e);
-                    } finally {
+        public void testEchoXMLCompleteASync() throws Exception {
+            SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
+                                          
+                SOAPEnvelope reqEnv = fac.getDefaultEnvelope();
+                OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+                OMElement method = fac.createOMElement("echoOMElement", omNs);
+                OMElement value = fac.createOMElement("myValue", omNs);
+                value.setText("Isaac Assimov, the foundation Sega");
+                method.addChild(value);
+                reqEnv.getBody().addChild(method);
+    
+                org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
+    
+                call.setTo(targetEPR);
+                call.setListenerTransport("http", true);
+                call.setOperationName(operationName);
+                Callback callback = new Callback() {
+                    public void onComplete(AsyncResult result) {
+                        try {
+                            result.getResponseEnvelope().serialize(XMLOutputFactory.newInstance()
+                                    .createXMLStreamWriter(System.out));
+                        } catch (XMLStreamException e) {
+                            reportError(e);
+                        } finally {
+                            finish = true;
+                        }
+                    }
+    
+                    public void reportError(Exception e) {
+                        e.printStackTrace();
                         finish = true;
                     }
+                };
+    
+                call.sendReceiveAsync(reqEnv, callback);
+                while (!finish) {
+                    Thread.sleep(1000);
                 }
-
-                public void reportError(Exception e) {
-                    e.printStackTrace();
-                    finish = true;
-                }
-            };
-
-            call.sendReceiveAsync(reqEnv, callback);
-            while (!finish) {
-                Thread.sleep(1000);
+    
+                log.info("send the reqest");
             }
-
-            log.info("send the reqest");
-        }
 
 }

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/HandlerFailureTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/HandlerFailureTest.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/HandlerFailureTest.java
(original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/HandlerFailureTest.java
Wed May  4 04:36:42 2005
@@ -80,11 +80,9 @@
         Utils.addHandler(flow, culprit);
         Utils.addHandler(flow, new SpeakingHandler());
         
-        AxisService service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName());
+        AxisService service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName(),operationName);
         service.setInFlow(flow);
-        AxisOperation operation = new AxisOperation(operationName);
-        service.addOperation(operation);
-
+        
         UtilServer.start();
         UtilServer.deployService(Utils.createServiceContext(service,null));
         try {
@@ -96,7 +94,7 @@
     }
 
     public void testFailureAtServerResponseFlow() throws Exception {
-        AxisService service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName());
+        AxisService service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName(),operationName);
  
 
         Flow flow = new FlowImpl();

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MessageWithServerTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MessageWithServerTest.java?rev=168116&r1=168115&r2=168116&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MessageWithServerTest.java
(original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MessageWithServerTest.java
Wed May  4 04:36:42 2005
@@ -58,7 +58,7 @@
 
     protected void setUp() throws Exception {
         UtilServer.start();
-        AxisService service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName());
+        AxisService service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName(),operationName);
         
         
         service.setInFlow(new MockFlow("service inflow", 4));



Mime
View raw message