You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2008/05/02 19:50:55 UTC

[jira] Commented: (SYNAPSE-260) Setting transport.vfs.ContentType to "text/xml" causes BaseTransportException

    [ https://issues.apache.org/jira/browse/SYNAPSE-260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593828#action_12593828 ] 

Andreas Veithen commented on SYNAPSE-260:
-----------------------------------------

Indeed, BuilderUtil.getCharSetEncoding defaults the encoding to UTF-8 if no charset property is given in the content type. This is not appropriate in this particular context: if no encoding is specified the transport should let the XML parser determine it. I replaced the call to BuilderUtil.getCharSetEncoding so that charSetEnc is set to null in this case. I also corrected the test at the end of the BaseUtils#setSOAPEnvelope so that no exception is triggered.

> Setting transport.vfs.ContentType to "text/xml" causes BaseTransportException
> -----------------------------------------------------------------------------
>
>                 Key: SYNAPSE-260
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-260
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: NIGHTLY
>            Reporter: Andreas Veithen
>            Priority: Minor
>             Fix For: 1.2
>
>
> When the VFS transport (listener) is used with transport.vfs.ContentType set to "text/xml", the following exception is triggered when a file is received:
> org.apache.synapse.transport.base.BaseTransportException: Charset encoding of transport differs from that of the payload
> 	at org.apache.synapse.transport.base.BaseUtils.handleException(BaseUtils.java:331)
> 	at org.apache.synapse.transport.base.BaseUtils.setSOAPEnvelope(BaseUtils.java:228)
> 	at org.apache.synapse.transport.vfs.VFSTransportListener.processFile(VFSTransportListener.java:412)
> 	at org.apache.synapse.transport.vfs.VFSTransportListener.scanFileOrDirectory(VFSTransportListener.java:229)
> 	at org.apache.synapse.transport.vfs.VFSTransportListener.onPoll(VFSTransportListener.java:135)
> 	at org.apache.synapse.transport.base.AbstractPollingTransportListener$1$1.run(AbstractPollingTransportListener.java:77)
> 	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:613)
> Specifying the charset in the content type (e.g. "text/xml; charset=ISO-8859-1") avoids the problem, but the VFS transport should be able to receive XML without a priori knowledge of the encoding.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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