WSO2 ESB - writing files out of base64

前端 未结 2 931
一个人的身影
一个人的身影 2021-01-24 10:09

I have a proxy which accepts XML files with Base64 encoded files in it. For example the XML looks like:


  Hello World

        
相关标签:
2条回答
  • 2021-01-24 10:47

    You have several options,

    1. If file sizes are small, iterate through <attachments> and for each attachment, decode using the script mediator and write to a file with syntax like,

      <property name="transport.vfs.ReplyFileName"
                expression="expression-to-compute-file-name"
                scope="transport"/>
      <property action="set" name="OUT_ONLY" value="true"/>
      <send>
          <endpoint>
              <address uri="vfs:file:///home/user/test/out"/>
          </endpoint>
      </send>
      
    2. If the files are large then it's more efficient to write your own class mediator

    0 讨论(0)
  • 2021-01-24 11:12

    Send the files to an local filesystem . Use VFS proxy

    0 讨论(0)
提交回复
热议问题