You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2007/09/21 08:46:40 UTC

svn commit: r577999 - in /webservices/axis2/trunk/java/modules/kernel: resources/smtpfault-module.xml src/org/apache/axis2/transport/mail/server/SMTPFaultHandler.java

Author: deepal
Date: Thu Sep 20 23:46:40 2007
New Revision: 577999

URL: http://svn.apache.org/viewvc?rev=577999&view=rev
Log:
stating fix for AXIS2-3203
- Just need to add an entry to pom.xml to create a mar

Added:
    webservices/axis2/trunk/java/modules/kernel/resources/smtpfault-module.xml
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/SMTPFaultHandler.java

Added: webservices/axis2/trunk/java/modules/kernel/resources/smtpfault-module.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/resources/smtpfault-module.xml?rev=577999&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/resources/smtpfault-module.xml (added)
+++ webservices/axis2/trunk/java/modules/kernel/resources/smtpfault-module.xml Thu Sep 20 23:46:40 2007
@@ -0,0 +1,26 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements. See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership. The ASF licenses this file
+  ~ to you 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.
+  -->
+<module name="addressing" class="org.apache.axis2.addressing.AddressingModule">
+    <Description>This module is to handle the problem of not sending fault in the server side when SMTP transport is used</Description>
+    <InFlow>
+        <handler name="SMTPFaultHandler" class="org.apache.axis2.transport.mail.server.SMTPFaultHandler">
+            <order phase="Transport"/>
+        </handler>
+    </InFlow>
+</module>

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/SMTPFaultHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/SMTPFaultHandler.java?rev=577999&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/SMTPFaultHandler.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/mail/server/SMTPFaultHandler.java Thu Sep 20 23:46:40 2007
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.axis2.transport.mail.server;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.engine.Handler;
+import org.apache.axis2.handlers.AbstractHandler;
+
+/**
+ * This will handle faults for SMTP case.
+ */
+public class SMTPFaultHandler extends AbstractHandler {
+
+    public Handler.InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
+        return Handler.InvocationResponse.CONTINUE;
+    }
+
+
+    public void flowComplete(MessageContext msgContext) {
+        String protocol = msgContext.getIncomingTransportName();
+        if (protocol == null) {
+            return;
+        }
+
+        if (protocol.equalsIgnoreCase(Constants.TRANSPORT_MAIL) && msgContext.isServerSide()) {
+            // This will allow the faults to go out.
+            msgContext.setServerSide(false);
+        }
+
+    }
+}
+
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org