Customer wanted to know how to store files (retrieved by scheduled rule) locally on DataPower box.
Solution consists of:
* scheduled rule
* dp:url-open to retrieve file
* base64 encode it (either its serialization for XML, or the binaryNode response for Non-XML)
* use set-file XML management operation to store the file
* access XML management interface from within a stylesheet to execute the request
Find the details in this developerWorks DataPower Forum posting:
At the end of the posting a shell-script for conversion of a file to its corresponding XML management set-file request is provided.
This is handy for use with doSoma tool.
Here file "testfile" gets stored as "local:///myTestfile2" in "default" domain ...
$ set-file local://myTestfile2 testfile default | doSoma admin - dp3-l3:5550 |\ > tidy -q -xml Enter host password for user 'admin': <?xml version="1.0" encoding="utf-8"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <dp:response xmlns:dp="http://www.datapower.com/schemas/management"> <dp:timestamp>2011-07-07T05:36:47-04:00</dp:timestamp> <dp:result>OK</dp:result> </dp:response> </env:Body> </env:Envelope> $