WSO2 ESB VFS传输 - 期待SOAP信封

时间:2013-06-07 08:47:55

标签: wso2 wso2esb vfs

我正在尝试使用WSO2 ESB进行基于FTP的集成。我可以使用VFS传输将文件从一个FTP位置传输到另一个FTP位置。但WSO2 ESB预计文件中的肥皂信封正在转移。

如果Am传输图像,此逻辑将不适合。

如何使用VFS传输传输带有非肥皂信封的图像/文件?

如果我转移任何没有肥皂信封的文件,则会出现以下错误:

    [2013-06-07 14:01:31,314] ERROR - VFSTransportListener Error processing File URI
 : ftp://isova1:admin@10.208.29.144/isova.png
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8
 start byte 0x89 (at char #1, byte #-1)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.jav
a:296)
        at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelo
pe(StAXSOAPModelBuilder.java:204)
        at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSO
APModelBuilder.java:154)
        at org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAPModelBui
lder(AbstractOMMetaFactory.java:73)
        at org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPModelBuilder
(AbstractOMMetaFactory.java:79)
        at org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilder(OMXMLB
uilderFactory.java:196)
        at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java
:55)
        at org.apache.synapse.transport.vfs.VFSTransportListener.processFile(VFS
TransportListener.java:558)
        at org.apache.synapse.transport.vfs.VFSTransportListener.scanFileOrDirec
tory(VFSTransportListener.java:312)
        at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTranspo
rtListener.java:158)
        at org.apache.synapse.transport.vfs.VFSTransportListener.poll(VFSTranspo
rtListener.java:107)
        at org.apache.axis2.transport.base.AbstractPollingTransportListener$1$1.
run(AbstractPollingTransportListener.java:67)
        at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(Native
WorkerPool.java:172)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:895)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:918)
        at java.lang.Thread.run(Thread.java:662)
Caused by: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 start byte 0x89 (at c
har #1, byte #-1)
        at com.ctc.wstx.sr.StreamScanner.constructFromIOE(StreamScanner.java:625
)
        at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:994)
        at com.ctc.wstx.sr.StreamScanner.getNext(StreamScanner.java:754)
        at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.ja
va:1977)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1114)
        at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStr
eamReaderWrapper.java:225)
        at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWra
pper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
        at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStr
eamReaderWrapper.java:225)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuild
er.java:681)
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.jav
a:214)
        ... 15 more
Caused by: java.io.CharConversionException: Invalid UTF-8 start byte 0x89 (at ch
ar #1, byte #-1)
        at com.ctc.wstx.io.UTF8Reader.reportInvalidInitial(UTF8Reader.java:303)
        at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:189)
        at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:87)
        at com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.
java:57)
        at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:988)
        ... 23 more

此致 领袖 @gnanagurus

1 个答案:

答案 0 :(得分:0)

这很可能是因为未使用VFS传输的右ContentType

传输二进制数据时,请使用:

<parameter name="transport.vfs.ContentType">application/octet-stream</parameter>

我刚刚在WSO2 ESB 4.0.3上尝试了它,并且它对于png文件工作正常,而使用text/plain作为transport.vfs.ContentType参数的值则抛出了与您描述的相同的异常。 / p>

查看Synapse VFS服务参数here