Hi Niek,

All the properties of the in path of the message will be there for the out
path as well. So you can directly use the property name "filename" to
retrieve the file name at the outSequence.

<property name="transport.vfs.ReplyFileName"
expression="fn:concat(get-property('SYSTEM_DATE', 'yyMMddHHmmss'), '-',
get-property('filename'), '.xml')" scope="transport" />
Hope this helps...

Thanks,
Ruwan


2009/7/22 Niek Palm <[email protected]>

> I am trying to confiugre synapse to pick up files for the file system
> (vfs) send them to a web services an write the response to the file
> syste. I succees this basic scenario. Now I want to write the webservice
> response to a file that has the same file name as its origin. The
> problem is that I cannot not access the FILE NAME when the webservice is
> invoked. So I can I transfer a property to other mediators (e.g. form
> inSequence to outSequence).
>
> Here is my configuration:
>
>
> <proxy name="FileProxy" transports="vfs">
> <parameter name="transport.vfs.FileURI">file:///opt/synapse/inbox
> </parameter>
> <parameter name="transport.vfs.ContentType">application/xml</parameter>
> <parameter name="transport.vfs.FileNamePattern">.*\.xml</parameter>
> <parameter name="transport.PollInterval">1</parameter>
> <parameter
> name="transport.vfs.MoveAfterProcess">file:///opt/synapse/processed
> </parameter>
> <parameter
> name="transport.vfs.MoveAfterFailure">file:///opt/synapse/failed
> </parameter>
> <parameter name="transport.vfs.ActionAfterProcess">DELETE</parameter>
> <parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
> <parameter
> name="transport.vfs.MoveTimestampFormat">yyMMddHHmmss</parameter>
>
> <target>
> <inSequence>
>        <log level="custom">
>        <property name="filename" expression="get-property('transport',
> 'FILE_NAME')" /><property name="transport.vfs.ReplyFileName"
>        </log>
>
>        <send>
>                <endpoint key="soapService"></endpoint>
>        </send>
>
> </inSequence>
>
> <outSequence>
>
>        <property name="transport.vfs.ReplyFileName"
>                expression="fn:concat(get-property('SYSTEM_DATE',
>     'yyMMddHHmmss') ,
> '-',
>                get-property('????', '??? ref to FILE???'),
> '.xml')"
> scope="transport" />
>        <send>
>                <endpoint>
>                <address uri="vfs:file:///opt/synapse/outbox" />
>                </endpoint>
>        </send>
> </outSequence>
> </target>
> </proxy>
>
> Best Regard, Niek Palm
>



-- 
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: [email protected]; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

Reply via email to