ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cha...@apache.org
Subject svn commit: r398946 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/transport/mail/server/ integration/test/org/apache/axis2/mail/
Date Tue, 02 May 2006 14:43:02 GMT
Author: chamil
Date: Tue May  2 07:41:54 2006
New Revision: 398946

URL: http://svn.apache.org/viewcvs?rev=398946&view=rev
Log:
Fixing MailetRequestResponseRawXMLTest

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailServer.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/SMTPWorker.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailServer.java?rev=398946&r1=398945&r2=398946&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailServer.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailServer.java
Tue May  2 07:41:54 2006
@@ -23,6 +23,12 @@
         smtpServer.start();
         pop3Server = new POP3Server(st, popPort);
         pop3Server.start();
+        try {
+            log.info("Sleeping for a bit to let the mail server start up.");
+            Thread.sleep(2000);
+        } catch (InterruptedException e1) {
+            log.error(e1);
+        }
     }
 
     public MailServer(ConfigurationContext configurationContext, int popPort, int smtpPort)

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java?rev=398946&r1=398945&r2=398946&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java
Tue May  2 07:41:54 2006
@@ -11,6 +11,8 @@
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.TransportInDescription;
+import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -53,7 +55,6 @@
     }
 
     public void processMail(ConfigurationContext confContext, MimeMessage mimeMessage) {
-
         // create an Axis server
         AxisEngine engine = new AxisEngine(confContext);
         MessageContext msgContext = null;
@@ -62,17 +63,20 @@
         try {
             msgContext = new MessageContext();
             msgContext.setConfigurationContext(confContext);
-            msgContext.setTransportIn(confContext.getAxisConfiguration()
-                    .getTransportIn(new QName(Constants
-                    .TRANSPORT_MAIL)));
-            msgContext.setTransportOut(confContext.getAxisConfiguration()
-                    .getTransportOut(new QName(Constants
-                    .TRANSPORT_MAIL)));
+            msgContext.setTransportIn(confContext.getAxisConfiguration().getTransportIn(new
QName(Constants.TRANSPORT_MAIL)));
+            msgContext.setTransportOut(confContext.getAxisConfiguration().getTransportOut(new
QName(Constants.TRANSPORT_MAIL)));
 
             msgContext.setServerSide(true);
             msgContext.setProperty(MailSrvConstants.CONTENT_TYPE, mimeMessage.getContentType());
-            msgContext.setWSAAction(getMailHeader(MailSrvConstants.HEADER_SOAP_ACTION,
-                    mimeMessage));
+            msgContext.setProperty(MessageContext.CHARACTER_SET_ENCODING,
+                    mimeMessage.getEncoding());
+            String soapAction = getMailHeader(MailSrvConstants.HEADER_SOAP_ACTION, mimeMessage);
+            if (soapAction == null){
+            	soapAction = mimeMessage.getSubject();
+            }
+
+            msgContext.setSoapAction(soapAction);
+            msgContext.setIncomingTransportName(Constants.TRANSPORT_MAIL);
 
             String serviceURL = mimeMessage.getSubject();
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/SMTPWorker.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/SMTPWorker.java?rev=398946&r1=398945&r2=398946&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/SMTPWorker.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/SMTPWorker.java
Tue May  2 07:41:54 2006
@@ -93,7 +93,6 @@
     }
 
     private String processInput(String input) {
-
         if (input == null) {
             return MailSrvConstants.COMMAND_UNKNOWN;
         }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java?rev=398946&r1=398945&r2=398946&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java
Tue May  2 07:41:54 2006
@@ -52,7 +52,7 @@
  */
 public class MailetRequestResponseRawXMLTest extends TestCase {
     private EndpointReference targetEPR =
-            new EndpointReference("axis2-server@127.0.0.1" +
+            new EndpointReference("mail:axis2-server@127.0.0.1" +
                     "/axis2/services/EchoXMLService/echoOMElement");
     private Log log = LogFactory.getLog(getClass());
     private QName serviceName = new QName("EchoXMLService");
@@ -115,8 +115,10 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
+        options.setAction(operationName.getLocalPart());
         options.setTransportInProtocol(Constants.TRANSPORT_MAIL);
         options.setUseSeparateListener(true);
+        
         Callback callback = new Callback() {
             public void onComplete(AsyncResult result) {
                 try {



Mime
View raw message