synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Veithen <andreas.veit...@gmail.com>
Subject Re: Error when retrieving mail from GMail
Date Mon, 04 May 2009 08:16:58 GMT
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 <saliya@wso2.com> wrote:
> I am using the snapshot.
>
> thanks,
> Saliya
>
> On Mon, May 4, 2009 at 1:13 PM, Andreas Veithen
> <andreas.veithen@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 <saliya@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 <saliya@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 <saliya@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-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
>
>
> --
> Saliya Ekanayake
> Software Engineer, WSO2 Inc. (http://www.wso2.com)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>

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


Mime
View raw message