0
votes

I like to save many attached files to the file system. For this I'm using the way described in this tutorial: http://wso2.com/library/knowledge-base/2011/06/saving-mtom-attachments-using-vfs-transport

It's working but I think it doesn't make sence to save alle files with the same file name. I need a new filename for every file, so this wouldn't work:

 <send>
   <endpoint name="endpoint_urn_uuid_121B17550AB61F010217054386886961-1720160132">
      <address uri="vfs:file:///home/amila/temp/vfs/woden-impl-dom-1.0-SNAPSHOT.jar"/>
   </endpoint>
 </send>

Then I found this question for an endpoint template: Dynamic Endpoint in WSO2

<send>
  <endpoint template="TemplateEndPoint">
    <parameter name="uri" value="http://localhost:8080/axis2/services/TaskService.TaskServiceHttpEndpoint/getTask" />
    <parameter name="name" value="Testing" />
  </endpoint>
</send>

If I got it right, it is possible to give this endpoint some parameters, but only values, no expression? I would need to give an expression for the uri, so that for example I can save the filename in an property and use this filename as the endpoint uri. Is this possible? For example something like that:

<send>
  <endpoint template="TemplateEndPoint">
    <parameter name="uri" expression="get-property('fileendpoint')" />
    <parameter name="name" value="Testing" />
  </endpoint>
</send>
1

1 Answers

0
votes

Please try the following code.

<property name="transport.vfs.ReplyFileName"
                  expression="fn:concat(get-property('ID'), '.xml')"
                  scope="transport"/>
        <property name="OUT_ONLY" value="true"/>
        <send>
           <endpoint>
              <address uri="vfs:file:///D:/Test/files/output/"/>
           </endpoint>
        </send>