Andreas,

Thank you for the quick response and resolution. I will test this and confirm.

On Sat, May 23, 2009 at 11:55 PM, Andreas Veithen
<andreas.veit...@gmail.com> wrote:
> Saliya,
>
> I updated sample 256 to work correctly with recent versions of the
> mail transport. The solution is to use the transport.mail.ContentType
> property (or alternatively send the request as SOAP 1.1 in an
> attachment with suffix ".xml").
>
> When testing the mail transport, you should also remove the
> geronimo-activation and geronimo-javamail JARs, which for the moment
> are included in the distribution (to be fixed).

Aha! this may have been the issue for getting a null subject for mail messages.

Thanks,
Saliya

>
> Andreas
>
> On Fri, May 22, 2009 at 20:20, Saliya Ekanayake <sal...@wso2.com> wrote:
>> Hi,
>>
>> I didn't specifically set it. Anyway, while debugging I found that
>> content type is text/plain and thus, the PlainTextBuilder is used.
>>
>> One additional thing: the subject of the mail message is always null
>> inside mail transport. I wrote a simple code fragment to check this on
>> my own and I could retrieve the subject of a mail message, but inside
>> the mail transport code this is returned as null. I used javax.mail
>> 1.4 (the transports trunk uses 1.4.x). Do you have any clarification
>> for this?
>>
>> Thank you for the support.
>>
>> Saliya
>>
>> On Fri, May 22, 2009 at 8:13 PM, Andreas Veithen
>> <andreas.veit...@gmail.com> wrote:
>>> Saliya,
>>>
>>> Did you try setting the transport.mail.ContentType property in the
>>> plain text case?
>>>
>>> Andreas
>>>
>>> On Fri, May 22, 2009 at 11:44, Saliya Ekanayake <sal...@wso2.com> wrote:
>>>> Hi Andreas,
>>>>
>>>> I tried the suggested approach, yet was unsuccessful. In both plain
>>>> text and attached message case I am getting the exception,
>>>>
>>>> ERROR AxisEngine The endpoint reference (EPR) for the Operation not
>>>> found is  and the WSA Action = null
>>>> org.apache.axis2.AxisFault: The endpoint reference (EPR) for the
>>>> Operation not found is  and the WSA Action = null
>>>>        at 
>>>> org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:89)
>>>>        at org.apache.axis2.engine.Phase.invoke(Phase.java:334)
>>>>        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:256)
>>>>        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:165)
>>>>        at 
>>>> org.apache.axis2.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:325)
>>>>        at 
>>>> org.apache.axis2.transport.mail.MailTransportListener.processMail(MailTransportListener.java:534)
>>>>        at 
>>>> org.apache.axis2.transport.mail.MailTransportListener.access$000(MailTransportListener.java:71)
>>>>        at 
>>>> org.apache.axis2.transport.mail.MailTransportListener$MailProcessor.run(MailTransportListener.java:350)
>>>>        at 
>>>> org.apache.axis2.transport.mail.MailTransportListener.processMail(MailTransportListener.java:314)
>>>>        at 
>>>> org.apache.axis2.transport.mail.MailTransportListener.checkMail(MailTransportListener.java:218)
>>>>        at 
>>>> org.apache.axis2.transport.mail.MailTransportListener.poll(MailTransportListener.java:99)
>>>>        at 
>>>> org.apache.axis2.transport.mail.MailTransportListener.poll(MailTransportListener.java:71)
>>>>        at 
>>>> org.apache.axis2.transport.base.AbstractPollingTransportListener$1$1.run(AbstractPollingTransportListener.java:99)
>>>>        at 
>>>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:58)
>>>>        at 
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>>>        at 
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>>>        at java.lang.Thread.run(Thread.java:595)
>>>>
>>>>
>>>>
>>>> I debugged into this and found that in the plain text case the
>>>> PlainTextBuilder builds an OMSourcedElement. The body based dispatcher
>>>> of Axis2 is thus unable to find the operation for the EPR.
>>>>
>>>> Any help on this is highly appreciated.
>>>>
>>>> Thanks
>>>> Saliya
>>>>
>>>> On Mon, May 4, 2009 at 1:46 PM, Andreas Veithen
>>>> <andreas.veit...@gmail.com> wrote:
>>>>> Saliya,
>>>>>
>>>>> One problem is that sample 256 is no longer compatible with the way
>>>>> the mail transport works in the snapshot. More precisely, in previous
>>>>> versions, the mail transport tried to parse the message as XML and
>>>>> fell back to plain text in case of error, completely ignoring the
>>>>> content type of the message. That is why the sample indicates to "send
>>>>> a plain/text email". This behavior had several issues, in particular
>>>>> the mail transport didn't use the message builder abstraction.
>>>>>
>>>>> Recent versions of the mail transport use the content type of the
>>>>> message to select a message builder and then delegate parsing of the
>>>>> message to the builder (in the same way as other transports). I see
>>>>> two ways one could adapt sample 256:
>>>>>
>>>>> - Instead of sending the XML inside the body, send it as attachment.
>>>>> This is supported by the mail transport, but it is a bit tricky
>>>>> because the content type of the attachment will depend on the email
>>>>> client or operation system that is used.
>>>>>
>>>>> - Play with the transport.mail.ContentType property to override the
>>>>> content type of the message.
>>>>>
>>>>> Andreas
>>>>>
>>>>> On Mon, May 4, 2009 at 09:53, Saliya Ekanayake <sal...@wso2.com> wrote:
>>>>>> I am using the snapshot.
>>>>>>
>>>>>> thanks,
>>>>>> Saliya
>>>>>>
>>>>>> On Mon, May 4, 2009 at 1:13 PM, Andreas Veithen
>>>>>> <andreas.veit...@gmail.com> wrote:
>>>>>>> Saliya,
>>>>>>>
>>>>>>> Can you please tell us the version of Synapse you are using?
>>>>>>>
>>>>>>> Andreas
>>>>>>>
>>>>>>> On Mon, May 4, 2009 at 08:45, Saliya Ekanayake <sal...@wso2.com> wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I was able to get passed this by sending a plain text message from
>>>>>>>> GMail. It seems that when HTML formatted message is present, Synapse
>>>>>>>> cannot properly build the SOAP envelope.
>>>>>>>>
>>>>>>>> At the same time I found that the error with configuration occurs when
>>>>>>>> you send a mail from the same account as the recipient (the
>>>>>>>> configuration simply checks for the "from" address and send the
>>>>>>>> reply). So in fact I think it's not an error.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Saliya
>>>>>>>>
>>>>>>>> On Mon, May 4, 2009 at 11:41 AM, Saliya Ekanayake <sal...@wso2.com> 
>>>>>>>> wrote:
>>>>>>>>> Regarding issue 2, I think the reason is having a wrong input stream 
>>>>>>>>> in
>>>>>>>>> creating the XMLStreamReader. The input stream taken from the message
>>>>>>>>> contains all the headers as well (I did a debug and found the 
>>>>>>>>> presence of
>>>>>>>>> headers). Thus, when parsing the stream to create a SOAP message I 
>>>>>>>>> hit the
>>>>>>>>> error "Unexpected character" (Woodstock 3.2.4: BasicStreamReader: line
>>>>>>>>> 2047).
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Saliya
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Mon, May 4, 2009 at 10:22 AM, Saliya Ekanayake <sal...@wso2.com> 
>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Hi all,
>>>>>>>>>>
>>>>>>>>>> I have encountered two issues with sample 256 - using mail transport 
>>>>>>>>>> with
>>>>>>>>>> Synapse.
>>>>>>>>>>
>>>>>>>>>> 1. The configuration is wrong as it simply sends the response back 
>>>>>>>>>> to the
>>>>>>>>>> same mail address. Then, Synapse will again send that response mail 
>>>>>>>>>> back to
>>>>>>>>>> the service thinking it is a request.
>>>>>>>>>>
>>>>>>>>>> 2. When retrieving mail from GMail I am getting a null pointer 
>>>>>>>>>> exception
>>>>>>>>>> due to null charset while parsing.
>>>>>>>>>>
>>>>>>>>>> The first issue can be corrected by modifying the configuration. The
>>>>>>>>>> second one, however, was bit unclear to me even after a debug. Could 
>>>>>>>>>> someone
>>>>>>>>>> please help on this. To reproduce this simply run sample 256 as 
>>>>>>>>>> given.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> Saliya
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Saliya Ekanayake
>>>>>>>>> Software Engineer, WSO2 Inc. (http://www.wso2.com)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Saliya Ekanayake
>>>>>>>> Software Engineer, WSO2 Inc. (http://www.wso2.com)
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
>>>>>>>> For additional commands, e-mail: dev-h...@synapse.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
>>>>>>> For additional commands, e-mail: dev-h...@synapse.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Saliya Ekanayake
>>>>>> Software Engineer, WSO2 Inc. (http://www.wso2.com)
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
>>>>>> For additional commands, e-mail: dev-h...@synapse.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
>>>>> For additional commands, e-mail: dev-h...@synapse.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Saliya Ekanayake
>>>> Software Engineer, WSO2 Inc. (http://www.wso2.com)
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
>>>> For additional commands, e-mail: dev-h...@synapse.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
>>> For additional commands, e-mail: dev-h...@synapse.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Saliya Ekanayake
>> Software Engineer, WSO2 Inc. (http://www.wso2.com)
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
>> For additional commands, e-mail: dev-h...@synapse.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
> For additional commands, e-mail: dev-h...@synapse.apache.org
>
>



-- 
Saliya Ekanayake
Software Engineer, WSO2 Inc. (http://www.wso2.com)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@synapse.apache.org
For additional commands, e-mail: dev-h...@synapse.apache.org

Reply via email to