You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@sdm.de on 2008/05/28 15:10:15 UTC

[Axis2 1.3] SimpleMailListener denys SOAP11 content-ype

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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2 1.3] SimpleMailListener denys SOAP11 content-ype

Posted by "Asankha C. Perera" <as...@wso2.com>.
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">synapse.demo.0@gmail.com</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">synapse.demo.1@gmail.com</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



christopher.roelle@sdm.de 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: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>
>   

AW: [Axis2 1.3] SimpleMailListener denys SOAP11 content-ype

Posted by ch...@sdm.de.
Thanks for the quick help.
The spec you refer to is actually for SOAP12, therfore it is understandable to prohibit SOAP11. But I want to stay with SOAP11 completely. I specified my WSDL (I hope completely) for SOAP11 and expected the generated client-stub and server-sekelton to use also only SOAP11.
But during the processing of the incoming attachment on the server-side the SimpleMailListener is called. And as it is part of the product it is unchangable.

I am not sure, that I understand, where to specify the used SOAP-version. I can include bindings for 1.1 and 1.2 in the WSDL. But where do I tell client and server which version to use?

Thanks,
Christopher

PS: I very much appreciate the time you (all) spend to help all the axis-users. 


Hi,

This is done by definition. Mail transport listener has been written to tally with spec [1]. This spec strictly prohibits of using SOAP11. There is no interoperable way to set some of the header parameters for SOAP 11.  I believe it's time to make some amendments to spec to cope with all user cases. Please do create a JIRA.

Thank you!

Saminda

Reference:

[1]. http://people.apache.org/~pzf/SMTPBase64Binding.html


On Thu, May 29, 2008 at 9:59 AM, Deepal jayasinghe <de...@gmail.com> wrote:


	Please create a JIRA.
	
	Thank you!
	Deepal 


		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: axis-dev-unsubscribe@ws.apache.org
		For additional commands, e-mail: axis-dev-help@ws.apache.org
		
		
		 
		



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




-- 
Saminda Abeyruwan

Senior Software Engineer
WSO2 Inc. - www.wso2.org 

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


Re: [Axis2 1.3] SimpleMailListener denys SOAP11 content-ype

Posted by Saminda Abeyruwan <sa...@gmail.com>.
Hi,

This is done by definition. Mail transport listener has been written to
tally with spec [1]. This spec strictly prohibits of using SOAP11. There is
no interoperable way to set some of the header parameters for SOAP 11.  I
believe it's time to make some amendments to spec to cope with all user
cases. Please do create a JIRA.

Thank you!

Saminda

Reference:

[1]. http://people.apache.org/~pzf/SMTPBase64Binding.html

On Thu, May 29, 2008 at 9:59 AM, Deepal jayasinghe <de...@gmail.com>
wrote:

> Please create a JIRA.
>
> Thank you!
> Deepal
>
>  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: axis-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-dev-help@ws.apache.org
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
Saminda Abeyruwan

Senior Software Engineer
WSO2 Inc. - www.wso2.org

Re: [Axis2 1.3] SimpleMailListener denys SOAP11 content-ype

Posted by Deepal jayasinghe <de...@gmail.com>.
Please create a JIRA.

Thank you!
Deepal
> 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: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>
>   


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