Christopher

You can try the Mail transport implementation we have developed for Apache Synapse. This can be made to replace the Axis2 Mail transport, but dropping the JAR file [1] into your lib directory, and updating your axis2.xml as follows:

[1] http://repo1.maven.org/maven2/org/apache/synapse/synapse-transports/1.1.2/synapse-transports-1.1.2.jar

<transportReceiver name="mailto" class="org.apache.synapse.transport.mail.MailTransportListener">
       <!-- configure any optional POP3/IMAP properties
check com.sun.mail.pop3 and com.sun.mail.imap package documentation for more details-->
   </transportReceiver>
   ....
   <!-- Uncomment and configure the SMTP server information
check com.sun.mail.smtp package documentation for descriptions of properties <transportSender name="mailto" class="org.apache.synapse.transport.mail.MailTransportSender">
       <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
       <parameter name="mail.smtp.port">587</parameter>
       <parameter name="mail.smtp.starttls.enable">true</parameter>
       <parameter name="mail.smtp.auth">true</parameter>
       <parameter name="mail.smtp.user">synapse.demo.0</parameter>
       <parameter name="mail.smtp.password">mailpassword</parameter>
<parameter name="mail.smtp.from">[EMAIL PROTECTED]</parameter>
   </transportSender>-->

Now for each of your services, you can configure the mail properties on the services.xml using the following properties:

e.g.

        <parameter name="transport.mail.Address">[EMAIL PROTECTED]</parameter>
       <parameter name="transport.mail.Protocol">pop3</parameter>
       <parameter name="transport.PollInterval">5</parameter>
       <parameter name="mail.pop3.host">pop.gmail.com</parameter>
       <parameter name="mail.pop3.port">995</parameter>
       <parameter name="mail.pop3.user">synapse.demo.1</parameter>
       <parameter name="mail.pop3.password">mailpassword</parameter>
       <parameter 
name="mail.pop3.socketFactory.class">javax.net.ssl.SSLSocketFactory</parameter>
       <parameter name="mail.pop3.socketFactory.fallback">false</parameter>
       <parameter name="mail.pop3.socketFactory.port">995</parameter>

With the new mail transport, you can have multiple services listening on different email accounts with their own separate polling schedules etc.. and "message" can be within the body, an attachment etc, and the subject can be changed, or copies CC, BCC'ed etc.. This documentation is still not in a good format, but you can refer to the code <http://svn.apache.org/viewvc/synapse/trunk/java/modules/transports/src/main/java/org/apache/synapse/transport/mail/> and the Synapse samples <http://synapse.apache.org> for a better understanding.

asankha



[EMAIL PROTECTED] wrote:
Hi Team,
I have to send my SOAP-messages with SOAP11. But the server does not accept 
mails with the content-type text/xml:

[ERROR] According to the mail sepec, mail transport should support only 
application/soap+xml
[ERROR] Error in SimpleMailListener - processing mail
org.apache.axis2.AxisFault: According to the mail sepec, mail transport should 
support only application/soap+xml
        at 
org.apache.axis2.transport.mail.SimpleMailListener.buildSOAPEnvelope(SimpleMailListener.java:470)
...



Unfortunately this check is hardcoded into the SimpleMailListener:



if (contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
                            TransportUtils
                                    .processContentTypeForAction(contentType, 
msgContext);
                        } else {...

Is there any way around or did I simply miss some property to be set?

Thanks for helping,
Christopher

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to